(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
aarch64/
stack-protector-7.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-fstack-protector-all -mstack-protector-guard=sysreg -mstack-protector-guard-offset=16 -mstack-protector-guard-reg=tpidr_el0 -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 LDRs and
      17     STRs should be therefore be those associated with the stack protector
      18     tests themselves.
      19  
      20     Make sure the address of the canary value (tpidr_el0 + 16) is not
      21     spilled and reloaded, since that would give the attacker an opportunity
      22     to change the canary value.  */
      23  /* { dg-final { scan-assembler-times {\tmrs\t} 2 } } */
      24  /* { dg-final { scan-assembler-times {\tstr\t} 1 } } */
      25  /* { dg-final { scan-assembler-times {\tldr\t} 3 } } */