libgfortran/ChangeLog:
[official-gcc.git] / gcc / testsuite / gcc.dg / pr54087.c
blobabb0af3d9bb36deb7e7c88bf3b4e1f579dbd19b6
1 /* PR54087. Verify __atomic_sub (val) uses __atomic_add (-val) if there is no
2 atomic_aub. */
3 /* { dg-require-effective-target sync_int_long } */
4 /* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
5 /* { dg-final { scan-assembler-times "xadd" 2 } } */
8 int a;
10 int f1(int p)
12 return __atomic_sub_fetch(&a, p, __ATOMIC_SEQ_CST) == 0;
15 int f2(int p)
17 return __atomic_fetch_sub(&a, p, __ATOMIC_SEQ_CST) - p == 0;