2018-05-17 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr67770.c
blob9368524c145b0b92933e067cfc46792fa9df5552
1 /* PR target/67770 */
2 /* { dg-do run { target ia32 } } */
3 /* { dg-require-effective-target trampolines } */
4 /* { dg-options "-O2" } */
6 __attribute__ ((noinline)) void
7 foo (int i, void (* __attribute__ ((regparm (3))) bar) (int))
9 bar (i);
12 int
13 main ()
15 int p = 0;
17 __attribute__ ((regparm (3), noinline)) void
18 bar (int i)
20 if (__builtin_expect (i, 0))
21 ++p;
24 foo (0, bar);
25 bar (0);
27 if (p != 0)
28 __builtin_abort ();
30 foo (1, bar);
31 bar (1);
33 if (p != 2)
34 __builtin_abort ();
36 return 0;