Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/pr54087.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 /* PR54087. Verify __atomic_sub (val) uses __atomic_add (-val) if there is no |
2 atomic_aub. */ | |
3 /* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */ | |
4 /* { dg-require-effective-target sync_int_long } */ | |
5 /* { dg-final { scan-assembler-times "xadd" 2 } } */ | |
6 | |
7 | |
8 int a; | |
9 | |
10 int f1(int p) | |
11 { | |
12 return __atomic_sub_fetch(&a, p, __ATOMIC_SEQ_CST) == 0; | |
13 } | |
14 | |
15 int f2(int p) | |
16 { | |
17 return __atomic_fetch_sub(&a, p, __ATOMIC_SEQ_CST) - p == 0; | |
18 } |