1 // RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
3 // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
9 #pragma omp threadprivate(pvt)
11 #pragma omp teams distribute simd // expected-error {{unexpected OpenMP directive '#pragma omp teams distribute simd'}}
13 int main(int argc, char **argv) {
15 #pragma omp teams distribute simd
16 f; // expected-error {{use of undeclared identifier 'f'}}
18 #pragma omp teams distribute simd { // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
19 for (int i = 0; i < argc; ++i)
22 #pragma omp teams distribute simd ( // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
23 for (int i = 0; i < argc; ++i)
26 #pragma omp teams distribute simd[ // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
27 for (int i = 0; i < argc; ++i)
30 #pragma omp teams distribute simd] // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
31 for (int i = 0; i < argc; ++i)
34 #pragma omp teams distribute simd) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
35 for (int i = 0; i < argc; ++i)
38 #pragma omp teams distribute simd } // expected-warning {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
39 for (int i = 0; i < argc; ++i)
42 #pragma omp teams distribute simd
43 for (int i = 0; i < argc; ++i)
45 // expected-warning@+2 {{extra tokens at the end of '#pragma omp teams distribute simd' are ignored}}
47 #pragma omp teams distribute simd unknown()
48 for (int i = 0; i < argc; ++i)
51 for (int i = 0; i < argc; ++i)
54 #pragma omp teams distribute simd
55 for (int i = 0; i < argc; ++i)
58 #pragma omp teams distribute simd
59 for (int i = 0; i < argc; ++i) {
60 goto L1; // expected-error {{use of undeclared label 'L1'}}
64 for (int i = 0; i < 10; ++i) {
68 #pragma omp teams distribute simd
69 for (int i = 0; i < argc; ++i) {
71 break; // expected-error {{'break' statement cannot be used in OpenMP for loop}}
79 #pragma omp teams distribute simd default(none)
80 for (int i = 0; i < 10; ++i)
81 ++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}}
83 goto L2; // expected-error {{use of undeclared label 'L2'}}
85 #pragma omp teams distribute simd
86 for (int i = 0; i < argc; ++i)
90 #pragma omp teams distribute simd
91 for (int i = 0; i < argc; ++i) {
92 return 1; // expected-error {{cannot return from OpenMP region}}
95 [[]] // expected-error {{an attribute list cannot appear here}}
97 #pragma omp teams distribute simd
98 for (int n = 0; n < 100; ++n) {
102 #pragma omp teams distribute simd copyin(pvt) // expected-error {{unexpected OpenMP clause 'copyin' in directive '#pragma omp teams distribute simd'}}
103 for (int n = 0; n < 100; ++n) {}
108 void test_ordered() {
110 #pragma omp teams distribute simd ordered // expected-error {{unexpected OpenMP clause 'ordered' in directive '#pragma omp teams distribute simd'}}
111 for (int i = 0; i < 16; ++i)