1 /* Verify:
2 * -fomit-frame-pointer -fsanitize=shadow-call-stack -fno-exceptions -ffixed-x18.
3 * without outgoing.
4 * total frame <= 512 but > 256.
5 * callee-saved reg: x19, x20, x30.
6 * optimized code should use "stp x19, x20, [sp, -x]!" to save x19, x20 in prologue.
7 * optimized code should use "str x30, [sp " to save x30 in prologue.
8 * optimized code should use "ldp x19, x20, [sp], x" to retore x19, x20 in epilogue.
9 * optimized code should not restore x30 in epilogue. */
10
11 /* { dg-do compile } */
12 /* { dg-options "-O0 -fomit-frame-pointer -fsanitize=shadow-call-stack -fno-exceptions -ffixed-x18 --save-temps" } */
13
14 int func1 (void)
15 {
16 unsigned char a[200];
17 __asm__ ("":::"x19","x20","x30");
18 return 0;
19 }
20
21 /* { dg-final { scan-assembler-times {stp\tx19, x20, \[sp, -[0-9]+\]!} 1 } } */
22 /* { dg-final { scan-assembler-times {str\tx30, \[sp} 1 } } */
23 /* { dg-final { scan-assembler {ldp\tx19, x20, \[sp\], [0-9]+} } } */
24 /* { dg-final { scan-assembler-not {ld[r|p]\tx30, \[sp} } } */