| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-fopenmp" } */ |
| 3 |
|
| 4 |
typedef enum omp_event_handle_t |
| 5 |
{ |
| 6 |
__omp_event_handle_t_max__ = __UINTPTR_MAX__ |
| 7 |
} omp_event_handle_t; |
| 8 |
|
| 9 |
extern void omp_fulfill_event (omp_event_handle_t); |
| 10 |
|
| 11 |
void f (omp_event_handle_t x, omp_event_handle_t y, int z) |
| 12 |
{ |
| 13 |
#pragma omp task detach (x) detach (y) /* { dg-error "too many 'detach' clauses on a task construct" } */ |
| 14 |
; |
| 15 |
|
| 16 |
#pragma omp task mergeable detach (x) /* { dg-error "'detach' clause must not be used together with 'mergeable' clause" } */ |
| 17 |
; |
| 18 |
|
| 19 |
#pragma omp task detach (x) mergeable /* { dg-error "'detach' clause must not be used together with 'mergeable' clause" } */ |
| 20 |
; |
| 21 |
|
| 22 |
#pragma omp task detach (z) /* { dg-error "'detach' clause event handle has type 'int' rather than 'omp_event_handle_t'" } */ |
| 23 |
; |
| 24 |
|
| 25 |
#pragma omp parallel master default (none) /* { dg-message "enclosing 'parallel'" } */ |
| 26 |
#pragma omp task detach (x) /* { dg-error "'x' not specified in enclosing 'parallel'" } */ |
| 27 |
; |
| 28 |
|
| 29 |
#pragma omp task detach (x) default (none) /* This should work. */ |
| 30 |
omp_fulfill_event (x); |
| 31 |
|
| 32 |
#pragma omp task detach (x) firstprivate (x) /* { dg-error "the event handle of a 'detach' clause should not be in a data-sharing clause" } */ |
| 33 |
; |
| 34 |
|
| 35 |
#pragma omp task detach (x) shared (x) /* { dg-error "the event handle of a 'detach' clause should not be in a data-sharing clause" } */ |
| 36 |
; |
| 37 |
} |