1 /* { dg-do compile } */
2 /* { dg-options "-mdejagnu-cpu=power10 -O2" } */
3 /* { dg-require-effective-target powerpc_elfv2 } */
4 /* { dg-require-effective-target power10_ok } */
6 /* Test that potential sibcalls are generated when the caller does not
7 preserve the TOC, even for external calls; and that sibcalls are not
8 generated when the caller preserves the TOC but the callee does not. */
10 #pragma GCC target ("cpu=power10,pcrel")
11 int x (void) __attribute__((noipa
));
12 int y (void) __attribute__((noipa
));
13 int xx (void) __attribute__((noipa
));
30 #pragma GCC target ("cpu=power9,no-pcrel")
31 int normal_call (void)
43 #pragma GCC target ("cpu=power10,pcrel")
44 int notoc_sibcall (void)
49 int extern_sibcall (void)
54 /* { dg-final { scan-assembler {\mb x@notoc\M} } } */
55 /* { dg-final { scan-assembler {\mbl y\M} } } */
56 /* { dg-final { scan-assembler {\mb xx@notoc\M} } } */
57 /* { dg-final { scan-assembler {\mb yy@notoc\M} } } */