aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/gomp/atomic-10.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/gomp/atomic-10.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/gomp/atomic-10.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/gomp/atomic-10.c b/gcc-4.9/gcc/testsuite/c-c++-common/gomp/atomic-10.c
new file mode 100644
index 000000000..21d035e15
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/gomp/atomic-10.c
@@ -0,0 +1,25 @@
+/* PR middle-end/28046 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
+/* { dg-require-effective-target cas_int } */
+
+int a[3], b;
+struct C { int x; int y; } c;
+
+int bar (void), *baz (void);
+
+void
+foo (void)
+{
+#pragma omp atomic
+ a[2] += bar ();
+#pragma omp atomic
+ b += bar ();
+#pragma omp atomic
+ c.y += bar ();
+#pragma omp atomic
+ *baz () += bar ();
+}
+
+/* { dg-final { scan-tree-dump-times "__atomic_fetch_add" 4 "ompexp" } } */
+/* { dg-final { cleanup-tree-dump "ompexp" } } */