Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr67770.c

raw
1 /* PR target/67770 */
2 /* { dg-do run { target ia32 } } */
3 /* { dg-require-effective-target trampolines } */
4 /* { dg-options "-O2" } */
5
6 __attribute__ ((noinline)) void
7 foo (int i, void (* __attribute__ ((regparm (3))) bar) (int))
8 {
9 bar (i);
10 }
11
12 int
13 main ()
14 {
15 int p = 0;
16
17 __attribute__ ((regparm (3), noinline)) void
18 bar (int i)
19 {
20 if (__builtin_expect (i, 0))
21 ++p;
22 }
23
24 foo (0, bar);
25 bar (0);
26
27 if (p != 0)
28 __builtin_abort ();
29
30 foo (1, bar);
31 bar (1);
32
33 if (p != 2)
34 __builtin_abort ();
35
36 return 0;
37 }