(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
arm/
pac-8.c
       1  /* Testing return address signing.  */
       2  /* { dg-do run } */
       3  /* { dg-require-effective-target mbranch_protection_ok } */
       4  /* { dg-require-effective-target arm_pacbti_hw } */
       5  /* { dg-options "-march=armv8.1-m.main+pacbti+fp -mbranch-protection=pac-ret+leaf -mthumb -mfloat-abi=hard --save-temps -O0" } */
       6  
       7  #include <stdarg.h>
       8  #include <stdlib.h>
       9  
      10  int acc (int n, ...)
      11  {
      12      int sum = 0;
      13      va_list ptr;
      14  
      15      va_start (ptr, n);
      16  
      17      for (int i = 0; i < n; i++)
      18          sum += va_arg (ptr, int);
      19      va_end (ptr);
      20  
      21      return sum;
      22  }
      23  
      24  int main()
      25  {
      26    if (acc (3, 1, 2, 3) != 6)
      27      abort ();
      28  
      29    return 0;
      30  }
      31  
      32  /* { dg-final { scan-assembler-times "pac\tip, lr, sp" 2 } } */
      33  /* { dg-final { scan-assembler-times "aut\tip, lr, sp" 2 } } */
      34  /* { dg-final { scan-assembler-not "\tbti" } } */