1 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ferror-limit 100 %s -Wuninitialized
3 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=51 -ferror-limit 100 %s -Wuninitialized
8 #pragma omp error // expected-error {{'#pragma omp error' cannot be an immediate substatement}}
10 #pragma omp error // expected-error {{ERROR}}
13 #pragma omp error // expected-error {{'#pragma omp error' cannot be an immediate substatement}}
15 #pragma omp error // expected-error {{ERROR}}
18 #pragma omp error // expected-error {{'#pragma omp error' cannot be an immediate substatement}}
22 #pragma omp error // expected-error {{ERROR}}
25 #pragma omp error // expected-error {{'#pragma omp error' cannot be an immediate substatement}}
28 #pragma omp error // expected-error {{'#pragma omp error' cannot be an immediate substatement}}
31 #pragma omp error // expected-error {{ERROR}}
34 #pragma omp error // expected-error {{ERROR}}
36 #pragma omp error // expected-error {{ERROR}}
39 #pragma omp error // expected-error {{ERROR}}
43 #pragma omp error // expected-error {{'#pragma omp error' cannot be an immediate substatement}}
45 #pragma omp error // expected-error {{ERROR}}
48 #pragma omp error // expected-error {{ERROR}}
50 #pragma omp error // expected-error {{ERROR}}
54 #pragma omp error // expected-error {{'#pragma omp error' cannot be an immediate substatement}}
56 // expected-error@+1 {{ERROR}}
57 #pragma omp error at() // expected-error {{expected 'compilation' or 'execution' in OpenMP clause 'at'}}
59 // expected-error@+1 {{ERROR}}
60 #pragma omp error at(up) // expected-error {{expected 'compilation' or 'execution' in OpenMP clause 'at'}}
62 // expected-error@+3 {{ERROR}}
63 // expected-error@+2 {{expected ')'}}
64 // expected-note@+1 {{to match this '('}}
65 #pragma omp error at(up(a)) // expected-error {{expected 'compilation' or 'execution' in OpenMP clause 'at'}}
67 #pragma omp error at(execution) // no error
69 #pragma omp error at(compilation) // expected-error {{ERROR}}
71 // expected-error@+1 {{ERROR}}
72 #pragma omp error at(compilation) at(execution) //expected-error {{directive '#pragma omp error' cannot contain more than one 'at' clause}}
74 // expected-error@+1 {{ERROR}}
75 #pragma omp error severity() // expected-error {{expected 'fatal' or 'warning' in OpenMP clause 'severity'}}
76 // expected-error@+1 {{ERROR}}
77 #pragma omp error severity(xyz) // expected-error {{expected 'fatal' or 'warning' in OpenMP clause 'severity'}}
78 // expected-error@+1 {{ERROR}}
79 #pragma omp error severity(fatal) severity(warning) // expected-error {{directive '#pragma omp error' cannot contain more than one 'severity' clause}}
81 // expected-error@+1 {{ERROR}}
82 #pragma omp error severity(fatal) severity(fatal) // expected-error {{directive '#pragma omp error' cannot contain more than one 'severity' clause}}
84 // expected-warning@+2 {{WARNING}}
85 // expected-warning@+1 {{WARNING}}
86 #pragma omp error severity(warning) severity(warning) // expected-error {{directive '#pragma omp error' cannot contain more than one 'severity' clause}}
88 // expected-warning@+1 {{WARNING}}
89 #pragma omp error severity(warning) // expected-warning {{WARNING}}
90 #pragma omp error severity(fatal) // expected-error {{ERROR}}
92 // expected-warning@+1 {{WARNING}}
93 #pragma omp error at(compilation) severity(warning) // expected-warning {{WARNING}}
94 #pragma omp error at(execution) severity(warning) // no error, diagnosic at runtime
95 #pragma omp error at(compilation) severity(fatal) // expected-error {{ERROR}}
96 #pragma omp error at(execution) severity(fatal) // no error, error at runtime
98 #pragma omp error message("GPU compiler is needed.") // expected-error {{GPU compiler is needed}}
99 #pragma omp error at(compilation) message("GPU compiler is needed.") // expected-error {{GPU compiler is needed}}
100 #pragma omp error at(execution) message("GPU compiler is needed.") // no error
101 // expected-warning@+1 {{GPU compiler is needed.}}
102 #pragma omp error severity(warning) message("GPU compiler is needed.") // expected-warning {{GPU compiler is needed.}}
103 #pragma omp error severity(fatal) message("GPU compiler is needed.") // expected-error {{GPU compiler is needed}}
104 // expected-warning@+1 {{GPU compiler is needed.}}
105 #pragma omp error at(compilation) severity(warning) message("GPU compiler is needed.") // expected-warning {{GPU compiler is needed.}}
106 #pragma omp error at(compilation) severity(fatal) message("GPU compiler is needed.") // expected-error {{GPU compiler is needed.}}
107 #pragma omp error at(execution) severity(warning) message("GPU compiler is needed.") // no warning warning will emit at runtime.
108 #pragma omp error at(execution) severity(fatal) message("GPU compiler is needed.") // no warning warning will emit at runtime.
110 // expected-error@+1 {{GPU compiler is needed.}}
111 #pragma omp error message("GPU compiler is needed.") message("GPU compiler is needed.") // expected-error {{directive '#pragma omp error' cannot contain more than one 'message' clause}}
113 // expected-warning@+1 {{expected string literal in 'clause message' - ignoring}}
114 #pragma omp error message(a) // expected-error {{ERROR}}
115 // expected-error@+1 {{ERROR}}
116 #pragma omp error message() // expected-error {{expected expression}}
120 #pragma omp error at(execution) // expected-error {{unexpected 'execution' modifier in non-executable context}}
122 #pragma omp error at(compilation) // expected-error {{ERROR}}
125 #pragma omp error at(compilation) // expected-error {{ERROR}}
127 #pragma omp error at(execution) // expected-error {{unexpected 'execution' modifier in non-executable context}}
131 int main(int argc
, char **argv
) {
132 // expected-error@+1 {{ERROR}}
135 // expected-error@+1 {{ERROR}}
136 #pragma omp error untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp error'}}
138 #pragma omp error // expected-error {{'#pragma omp error' cannot be an immediate substatement}}
140 // expected-error@+1 {{ERROR}}
144 #pragma omp error // expected-error {{'#pragma omp error' cannot be an immediate substatement}}
146 // expected-error@+1 {{ERROR}}
150 #pragma omp error // expected-error {{'#pragma omp error' cannot be an immediate substatement}}
154 // expected-error@+1 {{ERROR}}
158 #pragma omp error // expected-error {{'#pragma omp error' cannot be an immediate substatement}}
161 #pragma omp error // expected-error {{'#pragma omp error' cannot be an immediate substatement}}
164 // expected-error@+1 {{ERROR}}
168 // expected-error@+1 {{ERROR}}
171 // expected-error@+1 {{ERROR}}
175 // expected-error@+1 {{ERROR}}
180 #pragma omp error // expected-error {{'#pragma omp error' cannot be an immediate substatement}}
182 // expected-error@+1 {{ERROR}}
186 // expected-error@+1 {{ERROR}}
189 // expected-error@+1 {{ERROR}}
194 #pragma omp error // expected-error {{'#pragma omp error' cannot be an immediate substatement}}
196 return tmain(argc
);// expected-note {{in instantiation of function template specialization 'tmain<int>' requested here}}