| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-fstack-protector-all -O2" } */ |
| 3 |
|
| 4 |
void __attribute__ ((noipa)) |
| 5 |
f (void) |
| 6 |
{ |
| 7 |
volatile int x; |
| 8 |
asm volatile ("" ::: |
| 9 |
"x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", |
| 10 |
"x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", |
| 11 |
"x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", |
| 12 |
"x24", "x25", "x26", "x27", "x28", "x30"); |
| 13 |
} |
| 14 |
|
| 15 |
/* The register clobbers above should not generate any single LDRs or STRs; |
| 16 |
all registers should be saved and restored in pairs. The only STRs |
| 17 |
should be therefore be those associated with the stack protector |
| 18 |
tests themselves. |
| 19 |
|
| 20 |
Make sure the address of the canary value is not spilled and reloaded, |
| 21 |
since that would give the attacker an opportunity to change the |
| 22 |
canary value. */ |
| 23 |
/* { dg-final { scan-assembler-times {\tstr\t} 1 } } */ |