diff gcc/testsuite/c-c++-common/gomp/atomic-15.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/c-c++-common/gomp/atomic-15.c	Fri Oct 27 22:46:09 2017 +0900
@@ -0,0 +1,44 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+int x = 6;
+
+int
+main ()
+{
+  int v;
+  #pragma omp atomic
+    x = x * 7 + 6;	/* { dg-error "expected|invalid form of" } */
+  #pragma omp atomic
+    x = x * 7 ^ 6;	/* { dg-error "expected|invalid form of" } */
+  #pragma omp atomic update
+    x = x - 8 + 6;	/* { dg-error "expected|invalid form of" } */
+  #pragma omp atomic
+    x = x ^ 7 | 2;	/* { dg-error "expected|invalid form of" } */
+  #pragma omp atomic
+    x = x / 7 * 2;	/* { dg-error "expected|invalid form of" } */
+  #pragma omp atomic
+    x = x / 7 / 2;	/* { dg-error "expected|invalid form of" } */
+  #pragma omp atomic capture
+    { v = x; x = x * 7 + 6; }	/* { dg-error "expected" "" { target c++ } } */
+  #pragma omp atomic capture
+    { v = x; x = x * 7 ^ 6; }	/* { dg-error "expected" "" { target c++ } } */
+  #pragma omp atomic capture
+    { v = x; x = x - 8 + 6; }	/* { dg-error "expected" "" { target c++ } } */
+  #pragma omp atomic capture
+    { v = x; x = x ^ 7 | 2; }	/* { dg-error "expected" "" { target c++ } } */
+  #pragma omp atomic capture
+    { v = x; x = x / 7 * 2; }	/* { dg-error "expected" "" { target c++ } } */
+  #pragma omp atomic capture
+    { v = x; x = x / 7 / 2; }	/* { dg-error "expected" "" { target c++ } } */
+  #pragma omp atomic capture
+    { x = x * 7 + 6; v = x; }	/* { dg-error "expected|uses two different expressions for memory" } */
+  #pragma omp atomic capture
+    { x = x * 7 ^ 6; v = x; }	/* { dg-error "expected|uses two different expressions for memory" } */
+  #pragma omp atomic capture
+    { x = x - 8 + 6; v = x; }	/* { dg-error "expected|uses two different expressions for memory" } */
+  #pragma omp atomic capture
+    { x = x ^ 7 | 2; v = x; }	/* { dg-error "expected|uses two different expressions for memory" } */
+  (void) v;
+  return 0;
+}