summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/return_address_sign_2.c
blob: c5c1439b92e6637f85c47c6161cd797c0d68df25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* Testing return address signing where combined instructions used.  */
/* { dg-do compile } */
/* { dg-options "-O2 -msign-return-address=all" } */
/* { dg-require-effective-target lp64 } */

int foo (int);
int bar (int, int);

int __attribute__ ((target ("arch=armv8.3-a")))
func1 (int a, int b, int c)
{
  /* paciasp */
  return a + foo (b) + c;
  /* retaa */
}

/* { dg-final { scan-assembler-times "paciasp" 1 } } */
/* { dg-final { scan-assembler-times "retaa" 1 } } */