libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-prof / pr45354.c
blob441d16144cb7ba76cdaa0cb490f30c9c966f49c2
1 /* { dg-require-effective-target freorder } */
2 /* { dg-options "-O2 -freorder-blocks-and-partition -fschedule-insns -fselective-scheduling" { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
4 extern void abort (void);
6 int ifelse_val2;
8 int __attribute__((noinline))
9 test_ifelse2 (int i)
11 int result = 0;
12 if (!i) /* count(6) */
13 result = 1; /* count(1) */
14 if (i == 1) /* count(6) */
15 result = 1024;
16 if (i == 2) /* count(6) */
17 result = 2; /* count(3) */
18 if (i == 3) /* count(6) */
19 return 8; /* count(2) */
20 if (i == 4) /* count(4) */
21 return 2048;
22 return result; /* count(4) */
25 void __attribute__((noinline))
26 call_ifelse ()
28 ifelse_val2 += test_ifelse2 (0);
29 ifelse_val2 += test_ifelse2 (2);
30 ifelse_val2 += test_ifelse2 (2);
31 ifelse_val2 += test_ifelse2 (2);
32 ifelse_val2 += test_ifelse2 (3);
33 ifelse_val2 += test_ifelse2 (3);
36 int
37 main()
39 call_ifelse ();
40 if (ifelse_val2 != 23)
41 abort ();
42 return 0;