1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s
3 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s
9 #pragma omp threadprivate(pvt)
11 #pragma omp target teams distribute // expected-error {{unexpected OpenMP directive '#pragma omp target teams distribute'}}
13 int main(int argc, char **argv) {
14 #pragma omp target teams distribute { // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
15 for (int i = 0; i < argc; ++i)
17 #pragma omp target teams distribute ( // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
18 for (int i = 0; i < argc; ++i)
20 #pragma omp target teams distribute[ // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
21 for (int i = 0; i < argc; ++i)
23 #pragma omp target teams distribute] // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
24 for (int i = 0; i < argc; ++i)
26 #pragma omp target teams distribute) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
27 for (int i = 0; i < argc; ++i)
29 #pragma omp target teams distribute } // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
30 for (int i = 0; i < argc; ++i)
32 #pragma omp target teams distribute
33 for (int i = 0; i < argc; ++i)
35 // expected-warning@+1 {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
36 #pragma omp target teams distribute unknown()
37 for (int i = 0; i < argc; ++i)
40 for (int i = 0; i < argc; ++i)
42 #pragma omp target teams distribute
43 for (int i = 0; i < argc; ++i)
45 #pragma omp target teams distribute
46 for (int i = 0; i < argc; ++i) {
47 goto L1; // expected-error {{use of undeclared label 'L1'}}
51 for (int i = 0; i < 10; ++i) {
54 #pragma omp target teams distribute
55 for (int i = 0; i < argc; ++i) {
57 break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
64 #pragma omp target teams distribute default(none)
65 for (int i = 0; i < 10; ++i)
66 ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
68 goto L2; // expected-error {{use of undeclared label 'L2'}}
69 #pragma omp target teams distribute
70 for (int i = 0; i < argc; ++i)
73 #pragma omp target teams distribute
74 for (int i = 0; i < argc; ++i) {
75 return 1; // expected-error {{cannot return from OpenMP region}}
78 [[]] // expected-error {{an attribute list cannot appear here}}
79 #pragma omp target teams distribute
80 for (int n = 0; n < 100; ++n) {
83 #pragma omp target teams distribute copyin(pvt) // expected-error {{unexpected OpenMP clause 'copyin' in directive '#pragma omp target teams distribute'}}
84 for (int n = 0; n < 100; ++n) {}
90 #pragma omp target teams distribute ordered // expected-error {{unexpected OpenMP clause 'ordered' in directive '#pragma omp target teams distribute'}}
91 for (int i = 0; i < 16; ++i)