1 // RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
7 #pragma omp threadprivate(pvt)
9 #pragma omp teams distribute parallel for // expected-error {{unexpected OpenMP directive '#pragma omp teams distribute parallel for'}}
11 int main(int argc, char **argv) {
13 #pragma omp teams distribute parallel for { // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for' are ignored}}
14 for (int i = 0; i < argc; ++i)
17 #pragma omp teams distribute parallel for ( // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for' are ignored}}
18 for (int i = 0; i < argc; ++i)
21 #pragma omp teams distribute parallel for[ // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for' are ignored}}
22 for (int i = 0; i < argc; ++i)
25 #pragma omp teams distribute parallel for] // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for' are ignored}}
26 for (int i = 0; i < argc; ++i)
29 #pragma omp teams distribute parallel for) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for' are ignored}}
30 for (int i = 0; i < argc; ++i)
33 #pragma omp teams distribute parallel for } // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for' are ignored}}
34 for (int i = 0; i < argc; ++i)
37 #pragma omp teams distribute parallel for
38 for (int i = 0; i < argc; ++i)
40 // expected-warning@+2 {{extra tokens at the end of '#pragma omp teams distribute parallel for' are ignored}}
42 #pragma omp teams distribute parallel for unknown()
43 for (int i = 0; i < argc; ++i)
46 for (int i = 0; i < argc; ++i)
49 #pragma omp teams distribute parallel for
50 for (int i = 0; i < argc; ++i)
53 #pragma omp teams distribute parallel for
54 for (int i = 0; i < argc; ++i) {
55 goto L1; // expected-error {{use of undeclared label 'L1'}}
59 for (int i = 0; i < 10; ++i) {
63 #pragma omp teams distribute parallel for
64 for (int i = 0; i < argc; ++i) {
66 break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
74 #pragma omp teams distribute parallel for default(none)
75 for (int i = 0; i < 10; ++i)
76 ++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}}
78 goto L2; // expected-error {{use of undeclared label 'L2'}}
80 #pragma omp teams distribute parallel for
81 for (int i = 0; i < argc; ++i)
85 #pragma omp teams distribute parallel for
86 for (int i = 0; i < argc; ++i) {
87 return 1; // expected-error {{cannot return from OpenMP region}}
90 [[]] // expected-error {{an attribute list cannot appear here}}
92 #pragma omp teams distribute parallel for
93 for (int n = 0; n < 100; ++n) {
97 #pragma omp teams distribute parallel for copyin(pvt) // expected-error {{unexpected OpenMP clause 'copyin' in directive '#pragma omp teams distribute parallel for'}}
98 for (int n = 0; n < 100; ++n) {}
103 void test_ordered() {
105 #pragma omp teams distribute parallel for ordered // expected-error {{unexpected OpenMP clause 'ordered' in directive '#pragma omp teams distribute parallel for'}}
106 for (int i = 0; i < 16; ++i)