summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/atomic-9.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/gomp/atomic-9.c')
-rw-r--r--gcc/testsuite/gcc.dg/gomp/atomic-9.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/atomic-9.c b/gcc/testsuite/gcc.dg/gomp/atomic-9.c
new file mode 100644
index 00000000000..128e9df5e4a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/atomic-9.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-gimple" } */
+
+volatile int *bar(void);
+
+void f1(void)
+{
+ #pragma omp atomic
+ *bar() += 1;
+}
+
+/* { dg-final { scan-tree-dump-times "__sync_fetch_and_add" 1 "gimple" { target i?86-*-* x86_64-*-* ia64-*-* powerpc*-*-* alpha*-*-* } } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */