1 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm -fexceptions -fcxx-exceptions -o - %s | FileCheck %s
2 
main()3 int main() {
4 // CHECK: @__kmpc_for_static_init
5 // CHECK-NOT: !llvm.mem.parallel_loop_access
6 // CHECK: @__kmpc_for_static_fini
7 #pragma omp for
8   for(int i = 0; i < 10; ++i);
9 // CHECK: @__kmpc_for_static_init
10 // CHECK-NOT: !llvm.mem.parallel_loop_access
11 // CHECK: @__kmpc_for_static_fini
12 #pragma omp for simd
13   for(int i = 0; i < 10; ++i);
14 // CHECK: @__kmpc_for_static_init
15 // CHECK-NOT: !llvm.mem.parallel_loop_access
16 // CHECK: @__kmpc_for_static_fini
17 #pragma omp for schedule(static)
18   for(int i = 0; i < 10; ++i);
19 // CHECK: @__kmpc_for_static_init
20 // CHECK-NOT: !llvm.mem.parallel_loop_access
21 // CHECK: @__kmpc_for_static_fini
22 #pragma omp for simd schedule(static)
23   for(int i = 0; i < 10; ++i);
24 // CHECK: @__kmpc_for_static_init
25 // CHECK-NOT: !llvm.mem.parallel_loop_access
26 // CHECK: @__kmpc_for_static_fini
27 #pragma omp for schedule(static, 2)
28   for(int i = 0; i < 10; ++i);
29 // CHECK: @__kmpc_for_static_init
30 // CHECK-NOT: !llvm.mem.parallel_loop_access
31 // CHECK: @__kmpc_for_static_fini
32 #pragma omp for simd schedule(static, 2)
33   for(int i = 0; i < 10; ++i);
34 // CHECK: @__kmpc_dispatch_init
35 // CHECK: !llvm.mem.parallel_loop_access
36 #pragma omp for schedule(auto)
37   for(int i = 0; i < 10; ++i);
38 // CHECK: @__kmpc_dispatch_init
39 // CHECK: !llvm.mem.parallel_loop_access
40 #pragma omp for simd schedule(auto)
41   for(int i = 0; i < 10; ++i);
42 // CHECK: @__kmpc_dispatch_init
43 // CHECK: !llvm.mem.parallel_loop_access
44 #pragma omp for schedule(runtime)
45   for(int i = 0; i < 10; ++i);
46 // CHECK: @__kmpc_dispatch_init
47 // CHECK: !llvm.mem.parallel_loop_access
48 #pragma omp for simd schedule(runtime)
49   for(int i = 0; i < 10; ++i);
50 // CHECK: @__kmpc_dispatch_init
51 // CHECK: !llvm.mem.parallel_loop_access
52 #pragma omp for schedule(guided)
53   for(int i = 0; i < 10; ++i);
54 // CHECK: @__kmpc_dispatch_init
55 // CHECK: !llvm.mem.parallel_loop_access
56 #pragma omp for simd schedule(guided)
57   for(int i = 0; i < 10; ++i);
58 // CHECK: @__kmpc_dispatch_init
59 // CHECK: !llvm.mem.parallel_loop_access
60 #pragma omp for schedule(dynamic)
61   for(int i = 0; i < 10; ++i);
62 // CHECK: @__kmpc_dispatch_init
63 // CHECK: !llvm.mem.parallel_loop_access
64 #pragma omp for simd schedule(dynamic)
65   for(int i = 0; i < 10; ++i);
66 // CHECK: @__kmpc_for_static_init
67 // CHECK-NOT: !llvm.mem.parallel_loop_access
68 // CHECK: @__kmpc_for_static_fini
69 #pragma omp for schedule(monotonic: static)
70   for(int i = 0; i < 10; ++i);
71 // CHECK: @__kmpc_for_static_init
72 // CHECK-NOT: !llvm.mem.parallel_loop_access
73 // CHECK: @__kmpc_for_static_fini
74 #pragma omp for simd schedule(monotonic: static)
75   for(int i = 0; i < 10; ++i);
76 // CHECK: @__kmpc_for_static_init
77 // CHECK-NOT: !llvm.mem.parallel_loop_access
78 // CHECK: @__kmpc_for_static_fini
79 #pragma omp for schedule(monotonic: static, 2)
80   for(int i = 0; i < 10; ++i);
81 // CHECK: @__kmpc_for_static_init
82 // CHECK-NOT: !llvm.mem.parallel_loop_access
83 // CHECK: @__kmpc_for_static_fini
84 #pragma omp for simd schedule(monotonic: static, 2)
85   for(int i = 0; i < 10; ++i);
86 // CHECK: @__kmpc_dispatch_init
87 // CHECK-NOT: !llvm.mem.parallel_loop_access
88 #pragma omp for schedule(monotonic: auto)
89   for(int i = 0; i < 10; ++i);
90 // CHECK: @__kmpc_dispatch_init
91 // CHECK-NOT: !llvm.mem.parallel_loop_access
92 #pragma omp for simd schedule(monotonic: auto)
93   for(int i = 0; i < 10; ++i);
94 // CHECK: @__kmpc_dispatch_init
95 // CHECK-NOT: !llvm.mem.parallel_loop_access
96 #pragma omp for schedule(monotonic: runtime)
97   for(int i = 0; i < 10; ++i);
98 // CHECK: @__kmpc_dispatch_init
99 // CHECK-NOT: !llvm.mem.parallel_loop_access
100 #pragma omp for simd schedule(monotonic: runtime)
101   for(int i = 0; i < 10; ++i);
102 // CHECK: @__kmpc_dispatch_init
103 // CHECK-NOT: !llvm.mem.parallel_loop_access
104 #pragma omp for schedule(monotonic: guided)
105   for(int i = 0; i < 10; ++i);
106 // CHECK: @__kmpc_dispatch_init
107 // CHECK-NOT: !llvm.mem.parallel_loop_access
108 #pragma omp for simd schedule(monotonic: guided)
109   for(int i = 0; i < 10; ++i);
110 // CHECK: @__kmpc_dispatch_init
111 // CHECK-NOT: !llvm.mem.parallel_loop_access
112 #pragma omp for schedule(monotonic: dynamic)
113   for(int i = 0; i < 10; ++i);
114 // CHECK: @__kmpc_dispatch_init
115 // CHECK-NOT: !llvm.mem.parallel_loop_access
116 #pragma omp for simd schedule(monotonic: dynamic)
117   for(int i = 0; i < 10; ++i);
118 // CHECK: @__kmpc_dispatch_init
119 // CHECK: !llvm.mem.parallel_loop_access
120 #pragma omp for schedule(nonmonotonic: guided)
121   for(int i = 0; i < 10; ++i);
122 // CHECK: @__kmpc_dispatch_init
123 // CHECK: !llvm.mem.parallel_loop_access
124 #pragma omp for simd schedule(nonmonotonic: guided)
125   for(int i = 0; i < 10; ++i);
126 // CHECK: @__kmpc_dispatch_init
127 // CHECK: !llvm.mem.parallel_loop_access
128 #pragma omp for schedule(nonmonotonic: dynamic)
129   for(int i = 0; i < 10; ++i);
130 // CHECK: @__kmpc_dispatch_init
131 // CHECK: !llvm.mem.parallel_loop_access
132 #pragma omp for simd schedule(nonmonotonic: dynamic)
133   for(int i = 0; i < 10; ++i);
134 // CHECK: @__kmpc_dispatch_init
135 // CHECK-NOT: !llvm.mem.parallel_loop_access
136 // CHECK: @__kmpc_dispatch_next
137 #pragma omp for schedule(static) ordered
138   for(int i = 0; i < 10; ++i);
139 // CHECK: @__kmpc_dispatch_init
140 // CHECK-NOT: !llvm.mem.parallel_loop_access
141 // CHECK: @__kmpc_dispatch_next
142 #pragma omp for simd schedule(static) ordered
143   for(int i = 0; i < 10; ++i);
144 // CHECK: @__kmpc_dispatch_init
145 // CHECK-NOT: !llvm.mem.parallel_loop_access
146 // CHECK: @__kmpc_dispatch_next
147 #pragma omp for schedule(static, 2) ordered(1)
148   for(int i = 0; i < 10; ++i);
149 // CHECK: @__kmpc_dispatch_init
150 // CHECK-NOT: !llvm.mem.parallel_loop_access
151 // CHECK: @__kmpc_dispatch_next
152 #pragma omp for simd schedule(static, 2) ordered
153   for(int i = 0; i < 10; ++i);
154 // CHECK: @__kmpc_dispatch_init
155 // CHECK-NOT: !llvm.mem.parallel_loop_access
156 // CHECK: @__kmpc_dispatch_next
157 #pragma omp for schedule(auto) ordered(1)
158   for(int i = 0; i < 10; ++i);
159 // CHECK: @__kmpc_dispatch_init
160 // CHECK-NOT: !llvm.mem.parallel_loop_access
161 #pragma omp for simd schedule(auto) ordered
162   for(int i = 0; i < 10; ++i);
163 // CHECK: @__kmpc_dispatch_init
164 // CHECK-NOT: !llvm.mem.parallel_loop_access
165 // CHECK: @__kmpc_dispatch_next
166 #pragma omp for schedule(runtime) ordered
167   for(int i = 0; i < 10; ++i);
168 // CHECK: @__kmpc_dispatch_init
169 // CHECK-NOT: !llvm.mem.parallel_loop_access
170 // CHECK: @__kmpc_dispatch_next
171 #pragma omp for simd schedule(runtime) ordered
172   for(int i = 0; i < 10; ++i);
173 // CHECK: @__kmpc_dispatch_init
174 // CHECK-NOT: !llvm.mem.parallel_loop_access
175 // CHECK: @__kmpc_dispatch_next
176 #pragma omp for schedule(guided) ordered(1)
177   for(int i = 0; i < 10; ++i);
178 // CHECK: @__kmpc_dispatch_init
179 // CHECK-NOT: !llvm.mem.parallel_loop_access
180 // CHECK: @__kmpc_dispatch_next
181 #pragma omp for simd schedule(guided) ordered
182   for(int i = 0; i < 10; ++i);
183 // CHECK: @__kmpc_dispatch_init
184 // CHECK-NOT: !llvm.mem.parallel_loop_access
185 // CHECK: @__kmpc_dispatch_next
186 #pragma omp for schedule(dynamic) ordered(1)
187   for(int i = 0; i < 10; ++i);
188 // CHECK: @__kmpc_dispatch_init
189 // CHECK-NOT: !llvm.mem.parallel_loop_access
190 // CHECK: @__kmpc_dispatch_next
191 #pragma omp for simd schedule(dynamic)
192   for(int i = 0; i < 10; ++i);
193   return 0;
194 }
195