[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / OpenMP / teams_distribute_parallel_for_proc_bind_messages.cpp
blob91cef308440fe38719c3c193bb63d91dffeaef55
1 // RUN: %clang_cc1 -verify=expected,omp51 -fopenmp %s -Wuninitialized
3 // RUN: %clang_cc1 -verify=expected,omp51 -fopenmp-simd %s -Wuninitialized
5 // RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -fopenmp-version=50 %s -Wuninitialized
7 // RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -fopenmp-version=50 %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 distribute parallel for proc_bind // expected-error {{expected '(' after 'proc_bind'}}
16 for (i = 0; i < argc; ++i)
17 foo();
18 #pragma omp target
19 #pragma omp teams distribute parallel for 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 '('}}
20 for (i = 0; i < argc; ++i)
21 foo();
22 #pragma omp target
23 #pragma omp teams distribute parallel for 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'}}
24 for (i = 0; i < argc; ++i)
25 foo();
26 #pragma omp target
27 #pragma omp teams distribute parallel for proc_bind(master // expected-error {{expected ')'}} expected-note {{to match this '('}}
28 for (i = 0; i < argc; ++i)
29 foo();
30 #pragma omp target
31 #pragma omp teams distribute parallel for proc_bind(close), proc_bind(spread) // expected-error {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'proc_bind' clause}}
32 for (i = 0; i < argc; ++i)
33 foo();
34 #pragma omp target
35 #pragma omp teams distribute parallel for 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'}}
36 for (i = 0; i < argc; ++i)
37 foo();
39 #pragma omp target
40 #pragma omp teams distribute parallel for proc_bind(master)
41 for (i = 0; i < argc; ++i)
42 foo();
44 #pragma omp parallel proc_bind(close)
45 #pragma omp target
46 #pragma omp teams distribute parallel for proc_bind(spread)
47 for (i = 0; i < argc; ++i)
48 foo();
50 return T();
53 int main(int argc, char **argv) {
54 int i;
55 #pragma omp target
56 #pragma omp teams distribute parallel for proc_bind // expected-error {{expected '(' after 'proc_bind'}}
57 for (i = 0; i < argc; ++i)
58 foo();
59 #pragma omp target
60 #pragma omp teams distribute parallel for 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 '('}}
61 for (i = 0; i < argc; ++i)
62 foo();
63 #pragma omp target
64 #pragma omp teams distribute parallel for 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'}}
65 for (i = 0; i < argc; ++i)
66 foo();
67 #pragma omp target
68 #pragma omp teams distribute parallel for proc_bind(master // expected-error {{expected ')'}} expected-note {{to match this '('}}
69 for (i = 0; i < argc; ++i)
70 foo();
71 #pragma omp target
72 #pragma omp teams distribute parallel for proc_bind(close), proc_bind(spread) // expected-error {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'proc_bind' clause}}
73 for (i = 0; i < argc; ++i)
74 foo();
75 #pragma omp target
76 #pragma omp teams distribute parallel for 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'}}
77 for (i = 0; i < argc; ++i)
78 foo();
80 #pragma omp target
81 #pragma omp teams distribute parallel for proc_bind(master)
82 for (i = 0; i < argc; ++i)
83 foo();
85 #pragma omp parallel proc_bind(close)
86 #pragma omp target
87 #pragma omp teams distribute parallel for proc_bind(spread)
88 for (i = 0; i < argc; ++i)
89 foo();
90 return tmain<int, char, 3>(argc, argv);