1 // RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -triple x86_64-unknown-unknown -verify=expected,omp50 %s -Wuninitialized
2 // RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -verify=expected,omp51 %s -Wuninitialized
4 // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -triple x86_64-unknown-unknown -verify=expected,omp50 %s -Wuninitialized
5 // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -verify=expected,omp51 %s -Wuninitialized
7 extern int omp_get_num_threads (void);
9 int main(int argc
, char **argv
) {
11 #pragma omp parallel for order(concurrent)
12 for (int i
= 0; i
< 10; ++i
)
13 omp_get_num_threads(); // omp51-error {{calls to OpenMP runtime API are not allowed within a region that corresponds to a construct with an order clause that specifies concurrent}}
15 #pragma omp parallel for order(reproducible:concurrent) // omp50-error {{expected 'concurrent' in OpenMP clause 'order'}}
16 for (int i
= 0; i
< 10; ++i
)
17 omp_get_num_threads(); // omp51-error {{calls to OpenMP runtime API are not allowed within a region that corresponds to a construct with an order clause that specifies concurrent}}
19 #pragma omp parallel for order(unconstrained:concurrent) // omp50-error {{expected 'concurrent' in OpenMP clause 'order'}}
20 for (int i
= 0; i
< 10; ++i
)
21 omp_get_num_threads(); // omp51-error {{calls to OpenMP runtime API are not allowed within a region that corresponds to a construct with an order clause that specifies concurrent}}
23 #pragma omp parallel for order(concurrent)
24 for (int i
= 0; i
< 10; ++i
) {
25 for (int j
= 0; j
< 10; ++j
) {
26 omp_get_num_threads(); // omp51-error {{calls to OpenMP runtime API are not allowed within a region that corresponds to a construct with an order clause that specifies concurrent}}
30 #pragma omp parallel for order(concurrent)
31 for (int i
= 0; i
< 10; ++i
) {
32 #pragma omp atomic //omp51-error {{construct 'atomic' not allowed in a region associated with a directive with 'order' clause}}
36 #pragma omp parallel for order(reproducible: concurrent) // omp50-error {{expected 'concurrent' in OpenMP clause 'order'}}
37 for (int i
= 0; i
< 10; ++i
) {
38 #pragma omp target //omp51-error {{construct 'target' not allowed in a region associated with a directive with 'order' clause}}
42 #pragma omp parallel for order(unconstrained: concurrent) // omp50-error {{expected 'concurrent' in OpenMP clause 'order'}}
43 for (int i
= 0; i
< 10; ++i
) {
44 #pragma omp target //omp51-error {{construct 'target' not allowed in a region associated with a directive with 'order' clause}}