summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr54017.c65
2 files changed, 71 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index dee868fe17e..3283840121f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
+2012-07-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/54017
+ * c-c++-common/gomp/pr54017.c: New test.
+
2012-07-19 Richard Guenther <rguenther@suse.de>
- Eric Botcazou <ebotcazou@adacore.com>
+ Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/loop_optimization11.adb: New testcase.
* gnat.dg/loop_optimization11_pkg.ads: Likewise.
diff --git a/gcc/testsuite/c-c++-common/gomp/pr54017.c b/gcc/testsuite/c-c++-common/gomp/pr54017.c
new file mode 100644
index 00000000000..724efe13638
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr54017.c
@@ -0,0 +1,65 @@
+/* PR middle-end/54017 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void
+f1 (void)
+{
+#pragma omp parallel sections
+ {
+#pragma omp section
+ {
+ for (;;)
+ ;
+ }
+ }
+}
+
+int
+f2 (void)
+{
+ int i = 0;
+#pragma omp parallel
+#pragma omp sections reduction(+:i)
+ {
+#pragma omp section
+ {
+ for (;;)
+ ;
+ }
+ }
+ return i;
+}
+
+void
+f3 (void)
+{
+#pragma omp parallel sections
+ {
+#pragma omp section
+ {
+ for (;;)
+ ;
+ }
+#pragma omp section
+ ;
+ }
+}
+
+int
+f4 (void)
+{
+ int i = 0;
+#pragma omp parallel
+#pragma omp sections reduction(+:i)
+ {
+#pragma omp section
+ {
+ for (;;)
+ ;
+ }
+#pragma omp section
+ ;
+ }
+ return i;
+}
OpenPOWER on IntegriCloud