| 1 |
// { dg-do compile { target c++11 } } |
| 2 |
|
| 3 |
void |
| 4 |
foo (int x) |
| 5 |
{ |
| 6 |
[[omp::directive (parallel)]] |
| 7 |
#pragma omp for // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" } |
| 8 |
for (int i = 0; i < 16; i++) |
| 9 |
; |
| 10 |
[[omp::directive (barrier)]] // { dg-error "standalone OpenMP directives in 'omp::directive' attribute can only appear on an empty statement" } |
| 11 |
#pragma omp flush |
| 12 |
; |
| 13 |
#pragma omp parallel |
| 14 |
[[omp::directive (master)]] // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" } |
| 15 |
; |
| 16 |
#pragma omp teams |
| 17 |
[[omp::sequence (directive (parallel), directive (master))]] // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" } |
| 18 |
; |
| 19 |
#pragma omp task |
| 20 |
[[omp::directive (flush)]] // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" } |
| 21 |
; |
| 22 |
#pragma omp master |
| 23 |
[[omp::directive (flush)]] // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" } |
| 24 |
; |
| 25 |
#pragma omp for ordered |
| 26 |
for (int i = 0; i < 16; i++) |
| 27 |
#pragma omp ordered |
| 28 |
[[omp::directive (flush)]] // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" } |
| 29 |
; |
| 30 |
#pragma omp single |
| 31 |
[[omp::directive (flush)]] // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" } |
| 32 |
; |
| 33 |
#pragma omp taskgroup |
| 34 |
[[omp::directive (taskyield)]] // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" } |
| 35 |
; |
| 36 |
#pragma omp target data map (tofrom: x) |
| 37 |
[[omp::directive (flush)]] // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" } |
| 38 |
; |
| 39 |
#pragma omp target |
| 40 |
[[omp::directive (teams)]] // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" } |
| 41 |
; |
| 42 |
[[omp::directive (parallel)]] |
| 43 |
#pragma omp master // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" } |
| 44 |
[[omp::sequence (omp::directive (taskloop))]] // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" } |
| 45 |
for (int i = 0; i < 16; i++) |
| 46 |
; |
| 47 |
#pragma omp parallel |
| 48 |
[[omp::directive (for)]] // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" } |
| 49 |
for (int i = 0; i < 16; i++) |
| 50 |
; |
| 51 |
#pragma omp for |
| 52 |
[[omp::directive (master)]] // { dg-error "loop nest expected before '\\\[' token" } |
| 53 |
; |
| 54 |
#pragma omp target teams |
| 55 |
[[omp::directive (parallel)]] // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" } |
| 56 |
; |
| 57 |
#pragma omp parallel master |
| 58 |
[[omp::directive (taskloop)]] // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" } |
| 59 |
for (int i = 0; i < 16; i++) |
| 60 |
; |
| 61 |
} |