diff options
author | Joseph Myers <joseph@codesourcery.com> | 2013-11-18 14:50:11 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2013-11-18 14:50:11 +0000 |
commit | a2ca7c8cb966f02300a3775ba5575412aa6b1f94 (patch) | |
tree | 3ef9752a542301767b623ae7a0ea934a52f72ed6 /libatomic/testsuite/libatomic.c/atomic-exchange-3.c | |
parent | ad098ad1335f0e2684d721793232de8eab45936c (diff) | |
download | gcc-a2ca7c8cb966f02300a3775ba5575412aa6b1f94.tar.gz |
atomic-compare-exchange-1.c, [...]: Declare main as returning int.
* testsuite/libatomic.c/atomic-compare-exchange-1.c,
testsuite/libatomic.c/atomic-compare-exchange-2.c,
testsuite/libatomic.c/atomic-compare-exchange-3.c,
testsuite/libatomic.c/atomic-compare-exchange-4.c,
testsuite/libatomic.c/atomic-compare-exchange-5.c,
testsuite/libatomic.c/atomic-exchange-1.c,
testsuite/libatomic.c/atomic-exchange-2.c,
testsuite/libatomic.c/atomic-exchange-3.c,
testsuite/libatomic.c/atomic-exchange-4.c,
testsuite/libatomic.c/atomic-exchange-5.c,
testsuite/libatomic.c/atomic-generic.c,
testsuite/libatomic.c/atomic-load-1.c,
testsuite/libatomic.c/atomic-load-2.c,
testsuite/libatomic.c/atomic-load-3.c,
testsuite/libatomic.c/atomic-load-4.c,
testsuite/libatomic.c/atomic-load-5.c,
testsuite/libatomic.c/atomic-op-1.c,
testsuite/libatomic.c/atomic-op-2.c,
testsuite/libatomic.c/atomic-op-3.c,
testsuite/libatomic.c/atomic-op-4.c,
testsuite/libatomic.c/atomic-op-5.c,
testsuite/libatomic.c/atomic-store-1.c,
testsuite/libatomic.c/atomic-store-2.c,
testsuite/libatomic.c/atomic-store-3.c,
testsuite/libatomic.c/atomic-store-4.c,
testsuite/libatomic.c/atomic-store-5.c: Declare main as returning
int. Do not require built-in sync support or add target-specific
options.
* testsuite/libatomic.c/atomic-exchange-1.c,
testsuite/libatomic.c/atomic-exchange-2.c,
testsuite/libatomic.c/atomic-exchange-3.c,
testsuite/libatomic.c/atomic-exchange-4.c,
testsuite/libatomic.c/atomic-exchange-5.c: Separate increments of
count from expression using value of count.
From-SVN: r204953
Diffstat (limited to 'libatomic/testsuite/libatomic.c/atomic-exchange-3.c')
-rw-r--r-- | libatomic/testsuite/libatomic.c/atomic-exchange-3.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/libatomic/testsuite/libatomic.c/atomic-exchange-3.c b/libatomic/testsuite/libatomic.c/atomic-exchange-3.c index fbf8f6b966c..56841d99bb7 100644 --- a/libatomic/testsuite/libatomic.c/atomic-exchange-3.c +++ b/libatomic/testsuite/libatomic.c/atomic-exchange-3.c @@ -1,7 +1,6 @@ /* Test __atomic routines for existence and proper execution on 4 byte values with each valid memory model. */ /* { dg-do run } */ -/* { dg-require-effective-target sync_int_long } */ /* Test the execution of the __atomic_X builtin for an int. */ @@ -9,25 +8,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. */ |