d21963ce7a
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.
20 lines
343 B
C
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;
|
|
}
|