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