From 6997628d350a0961756e2e88095f3dd36d10bf8c Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sat, 8 Dec 2018 09:58:24 +0100 Subject: [PATCH] re PR libgomp/87995 (libgomp.c/../libgomp.c-c++-common/cancel-taskgroup-3.c fails consistently after r265930) PR libgomp/87995 * testsuite/libgomp.c-c++-common/cancel-taskgroup-3.c: Require tls_runtime effective target. (t): New threadprivate variable. (main): Set t in threads which execute iterations of the worksharing loop. Propagate that to the task after the loop and don't abort if the current taskgroup hasn't been cancelled. From-SVN: r266904 --- libgomp/ChangeLog | 10 ++++++++++ .../libgomp.c-c++-common/cancel-taskgroup-3.c | 13 +++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 171b5c7f177..7ce0cdb42e1 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,13 @@ +2018-12-08 Jakub Jelinek + + PR libgomp/87995 + * testsuite/libgomp.c-c++-common/cancel-taskgroup-3.c: Require + tls_runtime effective target. + (t): New threadprivate variable. + (main): Set t in threads which execute iterations of the worksharing + loop. Propagate that to the task after the loop and don't abort + if the current taskgroup hasn't been cancelled. + 2018-12-02 Jakub Jelinek * testsuite/libgomp.c/task-reduction-3.c: New test. diff --git a/libgomp/testsuite/libgomp.c-c++-common/cancel-taskgroup-3.c b/libgomp/testsuite/libgomp.c-c++-common/cancel-taskgroup-3.c index b9af83595b0..9e07cc10b65 100644 --- a/libgomp/testsuite/libgomp.c-c++-common/cancel-taskgroup-3.c +++ b/libgomp/testsuite/libgomp.c-c++-common/cancel-taskgroup-3.c @@ -1,9 +1,12 @@ -/* { dg-do run } */ +/* { dg-do run { target tls_runtime } } */ /* { dg-set-target-env-var OMP_CANCELLATION "true" } */ #include #include +int t; +#pragma omp threadprivate (t) + int main () { @@ -42,11 +45,12 @@ main () #pragma omp parallel #pragma omp taskgroup { - #pragma omp taskwait + int p; #pragma omp for reduction (task, +: a) for (i = 0; i < 64; ++i) { a++; + t = 1; #pragma omp task in_reduction (+: a) { volatile int zero = 0; @@ -58,9 +62,10 @@ main () } if (a != 64) abort (); - #pragma omp task + p = t; + #pragma omp task firstprivate (p) { - if (omp_get_cancellation ()) + if (p && omp_get_cancellation ()) abort (); } }