libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / inlinehint-5.c
blob218f80573c00846bc4b1b25af833cf30c64c3afc
1 /* { dg-options "-O2 -fdump-ipa-inline-details -fno-early-inlining " } */
2 /* { dg-add-options bind_pic_locally } */
3 int j,k,l;
4 int test3(int);
5 int test4(int);
7 static inline int
8 test2(int i)
10 if (__builtin_constant_p (i))
12 switch (i)
14 case 1: return j;
15 case 2: return k;
16 case 3: return l;
19 else return test3(i)+test4(i);
22 static inline int
23 test (int i)
25 return test2(i) + test2(i+1) + test3 (i) + test3(i) + test3(i) + test3 (i);
28 int
29 run (int i)
31 return test (i) + test (i);
33 /* The test should work by first inlining test2->test and then test to run
34 Both are called twice, so 4 hints (the second make sure that we propagate
35 to callers. */
36 /* { dg-final { scan-ipa-dump-times "hints: declared_inline builtin_constant_p" 4 "inline" } } */