Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/shrink-wrap-separate-0.c

raw
1 /* { dg-do compile { target powerpc*-*-* } } */
2 /* { dg-options "-O2" } */
3 /* { dg-final { scan-assembler {#before\M.*\mmflr\M} } } */
4
5 /* This tests if shrink-wrapping for separate components works.
6
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. */
12
13 void g(void);
14
15 void f(int x)
16 {
17 register int r20 asm("20") = x;
18 asm("#before" : : "r"(r20));
19 if (x)
20 g();
21 asm(""); // no tailcall of g
22 }