Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / teams_distribute_simd_default_messages.cpp
blob17e8d112de556c3a11b98b2bff92061d994b023d
1 // RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
3 // RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
5 void foo();
7 namespace {
8 static int y = 0;
10 static int x = 0;
12 int main(int argc, char **argv) {
13 #pragma omp target
14 #pragma omp teams distribute simd default // expected-error {{expected '(' after 'default'}}
15 for (int i=0; i<200; i++) foo();
16 #pragma omp target
17 #pragma omp teams distribute simd default( // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
18 for (int i=0; i<200; i++) foo();
19 #pragma omp target
20 #pragma omp teams distribute simd default() // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}}
21 for (int i=0; i<200; i++) foo();
22 #pragma omp target
23 #pragma omp teams distribute simd default (none // expected-error {{expected ')'}} expected-note {{to match this '('}}
24 for (int i=0; i<200; i++) foo();
25 #pragma omp target
26 #pragma omp teams distribute simd default (shared), default(shared) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'default' clause}}
27 for (int i=0; i<200; i++) foo();
28 #pragma omp target
29 #pragma omp teams distribute simd default(x) // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}}
30 for (int i=0; i<200; i++) foo();
32 #pragma omp target
33 #pragma omp teams distribute simd default(none) // expected-note {{explicit data sharing attribute requested here}}
34 for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
36 #pragma omp target
37 #pragma omp teams distribute simd default(firstprivate) // expected-note {{explicit data sharing attribute requested here}}
38 for (int i = 0; i < 200; i++)
39 ++x; // expected-error {{variable 'x' must have explicitly specified data sharing attributes}}
41 #pragma omp target
42 #pragma omp teams distribute simd default(firstprivate) // expected-note {{explicit data sharing attribute requested here}}
43 for (int i = 0; i < 200; i++)
44 ++y; // expected-error {{variable 'y' must have explicitly specified data sharing attributes}}
46 #pragma omp target
47 #pragma omp teams distribute simd default(private) // expected-note {{explicit data sharing attribute requested here}}
48 for (int i = 0; i < 200; i++)
49 ++x; // expected-error {{variable 'x' must have explicitly specified data sharing attributes}}
51 #pragma omp target
52 #pragma omp teams distribute simd default(private) // expected-note {{explicit data sharing attribute requested here}}
53 for (int i = 0; i < 200; i++)
54 ++y; // expected-error {{variable 'y' must have explicitly specified data sharing attributes}}
56 return 0;