aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/atomic-fence.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/atomic-fence.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-fence.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-fence.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-fence.c
new file mode 100644
index 000000000..ab5c7d62c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-fence.c
@@ -0,0 +1,28 @@
+/* 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. */
+
+int
+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;
+}
+