summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c++/pr39573.C
diff options
context:
space:
mode:
Diffstat (limited to 'libgomp/testsuite/libgomp.c++/pr39573.C')
-rw-r--r--libgomp/testsuite/libgomp.c++/pr39573.C39
1 files changed, 39 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c++/pr39573.C b/libgomp/testsuite/libgomp.c++/pr39573.C
new file mode 100644
index 000000000..0167222bc
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr39573.C
@@ -0,0 +1,39 @@
+// PR middle-end/39573
+// { dg-do run }
+
+int z;
+
+void __attribute__((noinline))
+bar (int *x)
+{
+ #pragma omp atomic
+ z += x[2];
+ x[2] += x[3];
+}
+
+int
+main ()
+{
+ int i;
+#pragma omp parallel for
+ for (i = 0; i < 65536; i++)
+ {
+ int x[] =
+ {
+ 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1,
+ 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1,
+ 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1,
+ 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1,
+ 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1,
+ 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1,
+ 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1,
+ 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 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