aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/atomic-fence.c
diff options
context:
space:
mode:
authorAndrew Macleod <amacleod@gcc.gnu.org>2011-11-06 14:55:48 +0000
committerAndrew Macleod <amacleod@gcc.gnu.org>2011-11-06 14:55:48 +0000
commit86951993f8a4cae2fb26bf8705e2f248a8d6f21e (patch)
treec0f499483e35c60c1b9f065f10a630e6fa4345bc /gcc/testsuite/gcc.dg/atomic-fence.c
parenta8a058f6523f1e0f7b69ec1837848e55cf9f0856 (diff)
downloadgcc-86951993f8a4cae2fb26bf8705e2f248a8d6f21e.zip
gcc-86951993f8a4cae2fb26bf8705e2f248a8d6f21e.tar.gz
gcc-86951993f8a4cae2fb26bf8705e2f248a8d6f21e.tar.bz2
Check in patch/merge from cxx-mem-model Branch
From-SVN: r181031
Diffstat (limited to 'gcc/testsuite/gcc.dg/atomic-fence.c')
-rw-r--r--gcc/testsuite/gcc.dg/atomic-fence.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/atomic-fence.c b/gcc/testsuite/gcc.dg/atomic-fence.c
new file mode 100644
index 0000000..1f6d187
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/atomic-fence.c
@@ -0,0 +1,27 @@
+/* Test __atomic routines for existence and execution with each valid
+ memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+
+/* Test that __atomic_{thread,signal}_fence builtins execute. */
+
+main ()
+{
+ __atomic_thread_fence (__ATOMIC_RELAXED);
+ __atomic_thread_fence (__ATOMIC_CONSUME);
+ __atomic_thread_fence (__ATOMIC_ACQUIRE);
+ __atomic_thread_fence (__ATOMIC_RELEASE);
+ __atomic_thread_fence (__ATOMIC_ACQ_REL);
+ __atomic_thread_fence (__ATOMIC_SEQ_CST);
+
+ __atomic_signal_fence (__ATOMIC_RELAXED);
+ __atomic_signal_fence (__ATOMIC_CONSUME);
+ __atomic_signal_fence (__ATOMIC_ACQUIRE);
+ __atomic_signal_fence (__ATOMIC_RELEASE);
+ __atomic_signal_fence (__ATOMIC_ACQ_REL);
+ __atomic_signal_fence (__ATOMIC_SEQ_CST);
+
+ return 0;
+}
+