aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/atomic_cmp_exchange_zero_strong_1.c
blob: 6daf9b08f5ace91aa357b85ea9c6a51e7ca812f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* { dg-do compile } */
/* { dg-options "-O2 -march=armv8-a+nolse -mno-outline-atomics" } */
/* { dg-skip-if "" { *-*-* } { "-mcpu=*" } { "" } } */

int
foo (int *a)
{
  int x = 0;
  return __atomic_compare_exchange_n (a, &x, 4, 0,
				      __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE);
}

/* { dg-final { scan-assembler-times "cbnz\\tw\[0-9\]+" 2 } } */