Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr79439-2.c
blobb53af445265910c7b27037877caddeca307c9e7f
1 /* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
2 /* { dg-options "-O2 -fpic -fno-reorder-blocks" } */
4 /* On the Linux 64-bit ABIs, we should not eliminate NOP in the 'rec' call if
5 -fpic is used because rec can be interposed at link time (since it has an
6 alias), and the recursive call should call the interposed function. The
7 Linux 32-bit ABIs do not require NOPs after the BL instruction. */
9 int f (void);
11 void
12 g (void)
16 int
17 rec (int a)
19 int ret = 0;
20 if (a > 10 && f ())
21 ret += rec (a - 1);
22 g ();
23 return a + ret;
26 int rec_alias (int) __attribute__ ((alias ("rec")));
28 /* { dg-final { scan-assembler-times {\mbl f\M} 1 } } */
29 /* { dg-final { scan-assembler-times {\mbl g\M} 1 } } */
30 /* { dg-final { scan-assembler-times {\mbl rec\M} 1 } } */
31 /* { dg-final { scan-assembler-times {\mnop\M} 3 } } */