1 // RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
7 #pragma omp threadprivate(pvt)
9 #pragma omp teams distribute parallel for simd // expected-error {{unexpected OpenMP directive '#pragma omp teams distribute parallel for simd'}}
11 int main(int argc, char **argv) {
13 #pragma omp teams distribute parallel for simd { // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for simd' are ignored}}
14 for (int i = 0; i < argc; ++i)
17 #pragma omp teams distribute parallel for simd ( // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for simd' are ignored}}
18 for (int i = 0; i < argc; ++i)
21 #pragma omp teams distribute parallel for simd[ // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for simd' are ignored}}
22 for (int i = 0; i < argc; ++i)
25 #pragma omp teams distribute parallel for simd] // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for simd' are ignored}}
26 for (int i = 0; i < argc; ++i)
29 #pragma omp teams distribute parallel for simd) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for simd' are ignored}}
30 for (int i = 0; i < argc; ++i)
33 #pragma omp teams distribute parallel for simd } // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for simd' are ignored}}
34 for (int i = 0; i < argc; ++i)
37 #pragma omp teams distribute parallel for simd
38 for (int i = 0; i < argc; ++i)
40 // expected-warning@+2 {{extra tokens at the end of '#pragma omp teams distribute parallel for simd' are ignored}}
42 #pragma omp teams distribute parallel for simd unknown()
43 for (int i = 0; i < argc; ++i)
46 for (int i = 0; i < argc; ++i)
49 #pragma omp teams distribute parallel for simd
50 for (int i = 0; i < argc; ++i)
53 #pragma omp teams distribute parallel for simd
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 simd
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 simd 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 simd
81 for (int i = 0; i < argc; ++i)
85 #pragma omp teams distribute parallel for simd
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 simd
93 for (int n = 0; n < 100; ++n) {
97 #pragma omp teams distribute parallel for simd copyin(pvt) // expected-error {{unexpected OpenMP clause 'copyin' in directive '#pragma omp teams distribute parallel for simd'}}
98 for (int n = 0; n < 100; ++n) {}
103 void test_ordered() {
105 #pragma omp teams distribute parallel for simd ordered // expected-error {{unexpected OpenMP clause 'ordered' in directive '#pragma omp teams distribute parallel for simd'}}
106 for (int i = 0; i < 16; ++i)