| 1 |
/* Testing the disable of shadow call stack. */ |
| 2 |
/* scs_push: str x30, [x18], #8 */ |
| 3 |
/* scs_pop: ldr x30, [x18, #-8]! */ |
| 4 |
/* { dg-do compile } */ |
| 5 |
/* { dg-options "-O2 -fno-omit-frame-pointer -fsanitize=shadow-call-stack -ffixed-x18 -fno-exceptions" } */ |
| 6 |
|
| 7 |
int foo (int); |
| 8 |
|
| 9 |
/* function disable shadow call stack. */ |
| 10 |
int __attribute__((no_sanitize("shadow-call-stack"))) func1 (void) |
| 11 |
{ |
| 12 |
asm volatile ("":::"x30"); |
| 13 |
|
| 14 |
return 0; |
| 15 |
} |
| 16 |
|
| 17 |
/* { dg-final { scan-assembler-not {str\tx30, \[x18\], #?8} } } */ |
| 18 |
/* { dg-final { scan-assembler-not {ldr\tx30, \[x18, #?-8\]!} } } */ |
| 19 |
/* { dg-final { scan-assembler-times {stp\tx29, x30, \[sp, -[0-9]+\]!} 1 } } */ |
| 20 |
/* { dg-final { scan-assembler-times {ldp\tx29, x30, \[sp\], [0-9]+} 1 } } */ |