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