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 parallel for // expected-error {{unexpected OpenMP directive '#pragma omp teams distribute parallel for'}}
13 int main(int argc, char **argv) {
15 #pragma omp teams distribute parallel for
16 f; // expected-error {{use of undeclared identifier 'f'}}
18 #pragma omp teams distribute parallel for { // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for' are ignored}}
19 for (int i = 0; i < argc; ++i)
22 #pragma omp teams distribute parallel for ( // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for' are ignored}}
23 for (int i = 0; i < argc; ++i)
26 #pragma omp teams distribute parallel for[ // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for' are ignored}}
27 for (int i = 0; i < argc; ++i)
30 #pragma omp teams distribute parallel for] // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for' are ignored}}
31 for (int i = 0; i < argc; ++i)
34 #pragma omp teams distribute parallel for) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for' are ignored}}
35 for (int i = 0; i < argc; ++i)
38 #pragma omp teams distribute parallel for } // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for' are ignored}}
39 for (int i = 0; i < argc; ++i)
42 #pragma omp teams distribute parallel for linear(argc) // expected-error {{unexpected OpenMP clause 'linear' in directive '#pragma omp teams distribute parallel for'}}
43 for (int i = 0; i < argc; ++i)
45 // expected-warning@+2 {{extra tokens at the end of '#pragma omp teams distribute parallel for' are ignored}}
47 #pragma omp teams distribute parallel for unknown()
48 for (int i = 0; i < argc; ++i)
51 for (int i = 0; i < argc; ++i)
54 #pragma omp teams distribute parallel for
55 for (int i = 0; i < argc; ++i)
58 #pragma omp teams distribute parallel for
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 parallel for
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 parallel for 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 parallel for
86 for (int i = 0; i < argc; ++i)
90 #pragma omp teams distribute parallel for
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 parallel for
98 for (int n = 0; n < 100; ++n) {
102 #pragma omp teams distribute parallel for copyin(pvt)
103 for (int n = 0; n < 100; ++n) {}
108 void test_ordered() {
110 #pragma omp teams distribute parallel for ordered // expected-error {{unexpected OpenMP clause 'ordered' in directive '#pragma omp teams distribute parallel for'}}
111 for (int i = 0; i < 16; ++i)
117 #pragma omp teams distribute parallel for
118 for (int i = 0; i < 16; ++i) {
119 #pragma omp cancel for