| 1 |
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized |
| 2 |
|
| 3 |
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized |
| 4 |
|
| 5 |
template <class T> |
| 6 |
T tmain(T argc) { |
| 7 |
#pragma omp taskwait allocate(argc) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp taskwait'}} |
| 8 |
#pragma omp taskwait depend(in:argc) // expected-error {{unexpected OpenMP clause 'depend' in directive '#pragma omp taskwait'}} |
| 9 |
; |
| 10 |
#pragma omp taskwait untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskwait'}} |
| 11 |
#pragma omp taskwait unknown // expected-warning {{extra tokens at the end of '#pragma omp taskwait' are ignored}} |
| 12 |
if (argc) |
| 13 |
#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} |
| 14 |
if (argc) { |
| 15 |
#pragma omp taskwait |
| 16 |
} |
| 17 |
while (argc) |
| 18 |
#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} |
| 19 |
while (argc) { |
| 20 |
#pragma omp taskwait |
| 21 |
} |
| 22 |
do |
| 23 |
#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} |
| 24 |
while (argc) |
| 25 |
; |
| 26 |
do { |
| 27 |
#pragma omp taskwait |
| 28 |
} while (argc); |
| 29 |
switch (argc) |
| 30 |
#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} |
| 31 |
switch (argc) |
| 32 |
case 1: |
| 33 |
#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} |
| 34 |
switch (argc) |
| 35 |
case 1: { |
| 36 |
#pragma omp taskwait |
| 37 |
} |
| 38 |
switch (argc) { |
| 39 |
#pragma omp taskwait |
| 40 |
case 1: |
| 41 |
#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} |
| 42 |
break; |
| 43 |
default: { |
| 44 |
#pragma omp taskwait |
| 45 |
} break; |
| 46 |
} |
| 47 |
for (;;) |
| 48 |
#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} |
| 49 |
for (;;) { |
| 50 |
#pragma omp taskwait |
| 51 |
} |
| 52 |
label: |
| 53 |
#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} |
| 54 |
label1 : { |
| 55 |
#pragma omp taskwait |
| 56 |
} |
| 57 |
|
| 58 |
return T(); |
| 59 |
} |
| 60 |
|
| 61 |
int main(int argc, char **argv) { |
| 62 |
#pragma omp taskwait |
| 63 |
; |
| 64 |
#pragma omp taskwait untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskwait'}} |
| 65 |
#pragma omp taskwait unknown // expected-warning {{extra tokens at the end of '#pragma omp taskwait' are ignored}} |
| 66 |
if (argc) |
| 67 |
#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} |
| 68 |
if (argc) { |
| 69 |
#pragma omp taskwait |
| 70 |
} |
| 71 |
while (argc) |
| 72 |
#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} |
| 73 |
while (argc) { |
| 74 |
#pragma omp taskwait |
| 75 |
} |
| 76 |
do |
| 77 |
#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} |
| 78 |
while (argc) |
| 79 |
; |
| 80 |
do { |
| 81 |
#pragma omp taskwait |
| 82 |
} while (argc); |
| 83 |
switch (argc) |
| 84 |
#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} |
| 85 |
switch (argc) |
| 86 |
case 1: |
| 87 |
#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} |
| 88 |
switch (argc) |
| 89 |
case 1: { |
| 90 |
#pragma omp taskwait |
| 91 |
} |
| 92 |
switch (argc) { |
| 93 |
#pragma omp taskwait |
| 94 |
case 1: |
| 95 |
#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} |
| 96 |
break; |
| 97 |
default: { |
| 98 |
#pragma omp taskwait |
| 99 |
} break; |
| 100 |
} |
| 101 |
for (;;) |
| 102 |
#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} |
| 103 |
for (;;) { |
| 104 |
#pragma omp taskwait |
| 105 |
} |
| 106 |
label: |
| 107 |
#pragma omp taskwait // expected-error {{'#pragma omp taskwait' cannot be an immediate substatement}} |
| 108 |
label1 : { |
| 109 |
#pragma omp taskwait |
| 110 |
} |
| 111 |
|
| 112 |
return tmain(argc); |
| 113 |
} |