summaryrefslogtreecommitdiff
path: root/libatomic/testsuite/libatomic.c/atomic-exchange-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'libatomic/testsuite/libatomic.c/atomic-exchange-2.c')
-rw-r--r--libatomic/testsuite/libatomic.c/atomic-exchange-2.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/libatomic/testsuite/libatomic.c/atomic-exchange-2.c b/libatomic/testsuite/libatomic.c/atomic-exchange-2.c
index 153771a2cdc..e06d729517f 100644
--- a/libatomic/testsuite/libatomic.c/atomic-exchange-2.c
+++ b/libatomic/testsuite/libatomic.c/atomic-exchange-2.c
@@ -1,7 +1,6 @@
/* Test __atomic routines for existence and proper execution on 2 byte
values with each valid memory model. */
/* { dg-do run } */
-/* { dg-require-effective-target sync_char_short } */
/* Test the execution of the __atomic_X builtin for a short. */
@@ -9,25 +8,31 @@ extern void abort(void);
short 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. */