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