[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / OpenMP / distribute_parallel_for_simd_proc_bind_messages.cpp
blobdfbe00fda66daa90ea321bb34829fe1f903bc405
1 // RUN: %clang_cc1 -verify=expected,omp51 -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
3 // RUN: %clang_cc1 -verify=expected,omp51 -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
5 // RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -fopenmp-version=50 -ferror-limit 100 -o - %s -Wuninitialized
7 // RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -fopenmp-version=50 -ferror-limit 100 -o - %s -Wuninitialized
9 void foo();
11 template <class T, typename S, int N>
12 T tmain(T argc, S **argv) {
13 T i;
14 #pragma omp target
15 #pragma omp teams
16 #pragma omp distribute parallel for simd proc_bind // expected-error {{expected '(' after 'proc_bind'}}
17 for (i = 0; i < argc; ++i)
18 foo();
19 #pragma omp target
20 #pragma omp teams
21 #pragma omp distribute parallel for simd proc_bind( // omp50-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}} omp51-error {{expected 'master', 'close', 'spread' or 'primary' in OpenMP clause 'proc_bind'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
22 for (i = 0; i < argc; ++i)
23 foo();
24 #pragma omp target
25 #pragma omp teams
26 #pragma omp distribute parallel for simd proc_bind() // omp50-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}} omp51-error {{expected 'master', 'close', 'spread' or 'primary' in OpenMP clause 'proc_bind'}}
27 for (i = 0; i < argc; ++i)
28 foo();
29 #pragma omp target
30 #pragma omp teams
31 #pragma omp distribute parallel for simd proc_bind(master // expected-error {{expected ')'}} expected-note {{to match this '('}}
32 for (i = 0; i < argc; ++i)
33 foo();
34 #pragma omp target
35 #pragma omp teams
36 #pragma omp distribute parallel for simd proc_bind(close), proc_bind(spread) // expected-error {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'proc_bind' clause}}
37 for (i = 0; i < argc; ++i)
38 foo();
39 #pragma omp target
40 #pragma omp teams
41 #pragma omp distribute parallel for simd proc_bind(x) // omp50-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}} omp51-error {{expected 'master', 'close', 'spread' or 'primary' in OpenMP clause 'proc_bind'}}
42 for (i = 0; i < argc; ++i)
43 foo();
45 #pragma omp target
46 #pragma omp teams
47 #pragma omp distribute parallel for simd proc_bind(master)
48 for (i = 0; i < argc; ++i)
49 foo();
51 #pragma omp parallel proc_bind(close)
52 #pragma omp target
53 #pragma omp teams
54 #pragma omp distribute parallel for simd proc_bind(spread)
55 for (i = 0; i < argc; ++i)
56 foo();
58 return T();
61 int main(int argc, char **argv) {
62 int i;
63 #pragma omp target
64 #pragma omp teams
65 #pragma omp distribute parallel for simd proc_bind // expected-error {{expected '(' after 'proc_bind'}}
66 for (i = 0; i < argc; ++i)
67 foo();
68 #pragma omp target
69 #pragma omp teams
70 #pragma omp distribute parallel for simd proc_bind( // omp50-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}} omp51-error {{expected 'master', 'close', 'spread' or 'primary' in OpenMP clause 'proc_bind'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
71 for (i = 0; i < argc; ++i)
72 foo();
73 #pragma omp target
74 #pragma omp teams
75 #pragma omp distribute parallel for simd proc_bind() // omp50-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}} omp51-error {{expected 'master', 'close', 'spread' or 'primary' in OpenMP clause 'proc_bind'}}
76 for (i = 0; i < argc; ++i)
77 foo();
78 #pragma omp target
79 #pragma omp teams
80 #pragma omp distribute parallel for simd proc_bind(master // expected-error {{expected ')'}} expected-note {{to match this '('}}
81 for (i = 0; i < argc; ++i)
82 foo();
83 #pragma omp target
84 #pragma omp teams
85 #pragma omp distribute parallel for simd proc_bind(close), proc_bind(spread) // expected-error {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'proc_bind' clause}}
86 for (i = 0; i < argc; ++i)
87 foo();
88 #pragma omp target
89 #pragma omp teams
90 #pragma omp distribute parallel for simd proc_bind(x) // omp50-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}} omp51-error {{expected 'master', 'close', 'spread' or 'primary' in OpenMP clause 'proc_bind'}}
91 for (i = 0; i < argc; ++i)
92 foo();
94 #pragma omp target
95 #pragma omp teams
96 #pragma omp distribute parallel for simd proc_bind(master)
97 for (i = 0; i < argc; ++i)
98 foo();
100 #pragma omp parallel proc_bind(close)
101 #pragma omp target
102 #pragma omp teams
103 #pragma omp distribute parallel for simd proc_bind(spread)
104 for (i = 0; i < argc; ++i)
105 foo();
106 return tmain<int, char, 3>(argc, argv);