Tobias Burnus d21963ce7a OpenMP: detach - fix firstprivate handling
gcc/ChangeLog:

	* omp-low.c (finish_taskreg_scan): Use the proper detach decl.

libgomp/ChangeLog:

	* testsuite/libgomp.c-c++-common/task-detach-12.c: New test.
	* testsuite/libgomp.fortran/task-detach-12.f90: New test.
2021-05-13 00:14:34 +02:00

20 lines
343 B
C

/* { dg-do run } */
/* { dg-options "-fopenmp" } */
#include <omp.h>
int
main ()
{
struct S { int a[7]; } s = { { 1, 2, 3, 4, 5, 6, 7 } };
omp_event_handle_t x;
#pragma omp parallel master
#pragma omp task firstprivate (s) detach (x)
{
if (s.a[3] != 4)
__builtin_abort ();
omp_fulfill_event (x);
}
return 0;
}