aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/bpf/atomic-cmpxchg-2.c
blob: 4036570ac6015f956741f56a7090d41c02c86163 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile } */
/* { dg-options "-mno-v3-atomics -O2" } */

int
foo (int *p, int *expected, int desired)
{
  return __atomic_compare_exchange (p, expected, &desired, 0,
				    __ATOMIC_ACQUIRE, __ATOMIC_RELAXED);
}

int
foo64 (long *p, long *expected, long desired)
{
  return __atomic_compare_exchange (p, expected, &desired, 0,
				    __ATOMIC_ACQUIRE, __ATOMIC_RELAXED);
}

/* { dg-final { scan-assembler-not "acmp\t.*" } } */
/* { dg-final { scan-assembler-not "acmp32\t.*" } } */