OSDN Git Service

* gcc.dg/attr-noinline.c: Avoid pure-const optimization.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / ipa / ipa-3.c
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining"  } */
3 /* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
4
5
6 /* Double constants.  */
7
8 #include <stdio.h>
9 void t(void);
10 int g (double b, double c)
11 {
12   t();
13   return (int)(b+c);  
14 }
15 int f (double a)
16 {
17   if (a > 0)
18     g (a, 3.1);
19   else
20     g (a, 3.1);         
21 }
22 int main ()
23 {
24   f (7.44);
25   return 0;     
26 }
27
28
29 /* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp"  } } */
30 /* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp"  } } */
31 /* { dg-final { scan-ipa-dump "replacing param b with const 7" "cp"  } } */
32 /* { dg-final { scan-ipa-dump "replacing param c with const 3" "cp"  } } */
33 /* { dg-final { cleanup-ipa-dump "cp" } } */