Debian Codegraph @

clang/test/OpenMP/target_teams_distribute_parallel_for_simd_default_messages.cpp

raw
1 // RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
2
3 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
4
5 // RUN: %clang_cc1 -verify -fopenmp-version=50 -DOMP50 -fopenmp %s -Wuninitialized
6
7 // RUN: %clang_cc1 -verify -fopenmp-version=50 -DOMP50 -fopenmp-simd %s -Wuninitialized
8
9 void foo();
10
11 namespace {
12 static int y = 0;
13 }
14 static int x = 0;
15
16 int main(int argc, char **argv) {
17 #pragma omp target teams distribute parallel for simd default // expected-error {{expected '(' after 'default'}}
18 for (int i=0; i<200; i++) foo();
19
20 #pragma omp target teams distribute parallel for simd default( // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
21 for (int i=0; i<200; i++) foo();
22
23 #pragma omp target teams distribute parallel for simd default() // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}}
24 for (int i=0; i<200; i++) foo();
25
26 #pragma omp target teams distribute parallel for simd default (none // expected-error {{expected ')'}} expected-note {{to match this '('}}
27 for (int i=0; i<200; i++) foo();
28
29 #pragma omp target teams distribute parallel for simd default (shared), default(shared) // expected-error {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'default' clause}}
30 for (int i=0; i<200; i++) foo();
31
32 #pragma omp target teams distribute parallel for simd default(x) // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}}
33 for (int i=0; i<200; i++) foo();
34
35 #pragma omp target teams distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
36 for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
37
38 #ifdef OMP50
39 #pragma omp target teams distribute parallel for simd default(firstprivate) // expected-error {{data-sharing attribute 'firstprivate' in 'default' clause requires OpenMP version 5.1 or above}}
40 for (int i = 0; i < argc; ++i) {
41 ++x;
42 ++y;
43 }
44 #pragma omp target teams distribute parallel for simd default(private) // expected-error {{data-sharing attribute 'private' in 'default' clause requires OpenMP version 5.1 or above}}
45 for (int i = 0; i < argc; ++i) {
46 ++x;
47 ++y;
48 }
49 #endif // OMP50
50
51 return 0;
52 }