Commit 6997628d by Jakub Jelinek Committed by Jakub Jelinek

re PR libgomp/87995 (libgomp.c/../libgomp.c-c++-common/cancel-taskgroup-3.c…

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
parent b03a4497
2018-12-08 Jakub Jelinek <jakub@redhat.com>
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 <jakub@redhat.com> 2018-12-02 Jakub Jelinek <jakub@redhat.com>
* testsuite/libgomp.c/task-reduction-3.c: New test. * testsuite/libgomp.c/task-reduction-3.c: New test.
......
/* { dg-do run } */ /* { dg-do run { target tls_runtime } } */
/* { dg-set-target-env-var OMP_CANCELLATION "true" } */ /* { dg-set-target-env-var OMP_CANCELLATION "true" } */
#include <stdlib.h> #include <stdlib.h>
#include <omp.h> #include <omp.h>
int t;
#pragma omp threadprivate (t)
int int
main () main ()
{ {
...@@ -42,11 +45,12 @@ main () ...@@ -42,11 +45,12 @@ main ()
#pragma omp parallel #pragma omp parallel
#pragma omp taskgroup #pragma omp taskgroup
{ {
#pragma omp taskwait int p;
#pragma omp for reduction (task, +: a) #pragma omp for reduction (task, +: a)
for (i = 0; i < 64; ++i) for (i = 0; i < 64; ++i)
{ {
a++; a++;
t = 1;
#pragma omp task in_reduction (+: a) #pragma omp task in_reduction (+: a)
{ {
volatile int zero = 0; volatile int zero = 0;
...@@ -58,9 +62,10 @@ main () ...@@ -58,9 +62,10 @@ main ()
} }
if (a != 64) if (a != 64)
abort (); abort ();
#pragma omp task p = t;
#pragma omp task firstprivate (p)
{ {
if (omp_get_cancellation ()) if (p && omp_get_cancellation ())
abort (); abort ();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment