summaryrefslogtreecommitdiff
path: root/libgomp/testsuite
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-13 16:59:20 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-13 16:59:20 +0000
commitb25f70fd08e427e7e0e9c197f62a05fcd98dfe89 (patch)
treea98a3f2c207b53f57c6310b769a54c75b47423f1 /libgomp/testsuite
parentac24a241155b26fcec492be038cd71eb2a0d3b2a (diff)
downloadgcc-b25f70fd08e427e7e0e9c197f62a05fcd98dfe89.tar.gz
PR middle-end/66133
* omp-low.c (expand_omp_taskreg): For GIMPLE_OMP_TASK expansion, make sure it is never noreturn, even when the task body does not return. (lower_omp_taskreg): For GIMPLE_OMP_TASK, emit GIMPLE_OMP_CONTINUE right before GIMPLE_OMP_RETURN. (make_gimple_omp_edges): Accept GIMPLE_OMP_CONTINUE as ->cont for GIMPLE_OMP_TASK. For GIMPLE_OMP_RETURN corresponding to GIMPLE_OMP_TASK add an EDGE_ABNORMAL edge from entry to exit. * testsuite/libgomp.c/pr66133.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223171 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp/testsuite')
-rw-r--r--libgomp/testsuite/libgomp.c/pr66133.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c/pr66133.c b/libgomp/testsuite/libgomp.c/pr66133.c
new file mode 100644
index 00000000000..e98e5aac412
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr66133.c
@@ -0,0 +1,35 @@
+/* PR middle-end/66133 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fopenmp" } */
+
+#include <stdlib.h>
+#include <unistd.h>
+
+volatile int x;
+
+__attribute__((noinline)) void
+foo (void)
+{
+ if (x == 0)
+ {
+ #pragma omp task
+ {
+ usleep (2000);
+ exit (0);
+ }
+ }
+ else
+ abort ();
+}
+
+int
+main ()
+{
+ #pragma omp parallel num_threads (2)
+ {
+ #pragma omp barrier
+ #pragma omp single
+ foo ();
+ }
+ exit (0);
+}