diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/atomic-exchange-3.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/atomic-exchange-3.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/testsuite/gcc.dg/atomic-exchange-3.c b/gcc/testsuite/gcc.dg/atomic-exchange-3.c index fbf8f6b966c..63a68cf473a 100644 --- a/gcc/testsuite/gcc.dg/atomic-exchange-3.c +++ b/gcc/testsuite/gcc.dg/atomic-exchange-3.c @@ -9,25 +9,31 @@ extern void abort(void); int v, count, ret; +int main () { v = 0; count = 0; - if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count++) + if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count) abort (); + count++; - if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count++) + if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count) abort (); + count++; - if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count++) + if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count) abort (); + count++; - if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count++) + if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count) abort (); + count++; - if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count++) + if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count) abort (); + count++; /* Now test the generic version. */ |