Add documentation for musttail attribute
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / shrink-wrap-separate-0.c
blobdea0611e8fc6542bd6d5728f4d6f956f6238db68
1 /* { dg-do compile { target powerpc*-*-* } } */
2 /* { dg-options "-O2" } */
3 /* { dg-final { scan-assembler {#before\M.*\mmflr\M} } } */
5 /* This tests if shrink-wrapping for separate components works.
7 r20 (a callee-saved register) is forced live at the start, so that we
8 get it saved in a prologue at the start of the function.
9 The link register only needs to be saved if x is non-zero; without
10 separate shrink-wrapping it would however be saved in the one prologue.
11 The test tests if the mflr insn ends up behind the prologue. */
13 void g(void);
15 void f(int x)
17 register int r20 asm("20") = x;
18 asm("#before" : : "r"(r20));
19 if (x)
20 g();
21 asm(""); // no tailcall of g