| 1 |
/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */ |
| 2 |
/* { dg-options "-O2 -fpic -fno-reorder-blocks -fno-inline-functions -mno-pcrel" } */ |
| 3 |
/* { dg-require-effective-target fpic } */ |
| 4 |
|
| 5 |
/* On the Linux 64-bit ABIs, we eliminate NOP in the 'rec' call even if |
| 6 |
-fpic is used. The recursive call should call the local alias. The |
| 7 |
Linux 32-bit ABIs do not require NOPs after the BL instruction. */ |
| 8 |
|
| 9 |
int f (void); |
| 10 |
|
| 11 |
void |
| 12 |
g (void) |
| 13 |
{ |
| 14 |
} |
| 15 |
|
| 16 |
int |
| 17 |
rec (int a) |
| 18 |
{ |
| 19 |
int ret = 0; |
| 20 |
if (a > 10 && f ()) |
| 21 |
ret += rec (a - 1); |
| 22 |
g (); |
| 23 |
return a + ret; |
| 24 |
} |
| 25 |
|
| 26 |
/* { dg-final { scan-assembler-times {\mbl f\M} 1 } } */ |
| 27 |
/* { dg-final { scan-assembler-times {\mbl g\M} 1 } } */ |
| 28 |
/* { dg-final { scan-assembler-times {\mbl rec\M} 1 } } */ |
| 29 |
/* { dg-final { scan-assembler-times {\mnop\M} 2 } } */ |