]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/ipa/pr109849.c
Compute ipa-predicates for conditionals involving __builtin_expect_p
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / ipa / pr109849.c
1 /* { dg-do compile } */
2 /* { dg-options "-Os -fdump-ipa-inline-details" } */
3 void bad (void);
4 void
5 test(int a)
6 {
7 if (__builtin_expect (a>3, 0))
8 {
9 bad ();
10 bad ();
11 bad ();
12 bad ();
13 bad ();
14 bad ();
15 bad ();
16 bad ();
17 }
18 }
19 void
20 foo (int a)
21 {
22 if (a>0)
23 __builtin_unreachable ();
24 test (a);
25 }
26 /* { dg-final { scan-ipa-dump "Inlined 2 calls" "inline" } } */
27 /* { dg-final { scan-ipa-dump "Inlining test" "inline" } } */