diff gcc/testsuite/gcc.dg/atomic-fence.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/gcc.dg/atomic-fence.c	Fri Oct 27 22:46:09 2017 +0900
@@ -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;
+}
+