libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / remref-5.c
blobc520e34d809ccc010e6d0bf3820ea1fed8f12107
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fno-early-inlining -fdump-ipa-cp-details -fdump-tree-optimized" } */
4 static double global = 0.0;
5 double foo_temp5;
7 static void foo(double *ptr) {
8 static double abcd;
9 double v, exp_res;
10 v = *ptr;
11 exp_res = __builtin_exp(v);
12 foo_temp5 = exp_res * abcd;
13 abcd += foo_temp5;
16 double last_value;
18 static void bar(double *ptr)
20 last_value = *ptr;
21 for (unsigned i = 0; i < 200; i++)
22 foo (ptr);
25 void entry()
27 bar (&global);
30 void decoy(double *ptr)
32 bar (ptr);
36 /* { dg-final { scan-ipa-dump "Removed a reference" "cp" } } */
37 /* { dg-final { scan-ipa-dump "replaced it with LOAD" "cp" } } */
38 /* { dg-final { scan-tree-dump-times "builtin_exp" 1 "optimized" } } */