| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-fshrink-wrap" } */ |
| 3 |
/* { dg-skip-if "" { *-*-* } { "-O0" "-Os" "-Oz" } } */ |
| 4 |
|
| 5 |
void g(void); |
| 6 |
|
| 7 |
void f(int x) |
| 8 |
{ |
| 9 |
if (x) |
| 10 |
{ |
| 11 |
/* Force saving of some callee-saved registers. With shrink wrapping |
| 12 |
enabled these only need to be saved if x is non-zero. */ |
| 13 |
register int s2 asm("18") = x; |
| 14 |
register int s3 asm("19") = x; |
| 15 |
register int s4 asm("20") = x; |
| 16 |
asm("" : : "r"(s2)); |
| 17 |
asm("" : : "r"(s3)); |
| 18 |
asm("" : : "r"(s4)); |
| 19 |
g(); |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
/* The resulting code should do nothing if X is 0. */ |
| 24 |
/* { dg-final { scan-assembler "bne\ta0,zero,.*\n.*ret" } } */ |