1 ///
2 /// Perform several driver tests for OpenMP offloading
3 ///
4 
5 // REQUIRES: clang-driver
6 // REQUIRES: x86-registered-target
7 // REQUIRES: powerpc-registered-target
8 // REQUIRES: nvptx-registered-target
9 // REQUIRES: amdgpu-registered-target
10 
11 /// ###########################################################################
12 
13 /// Check -Xopenmp-target uses one of the archs provided when several archs are used.
14 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
15 // RUN:          -Xopenmp-target -march=sm_35 -Xopenmp-target -march=sm_60 %s 2>&1 \
16 // RUN:   | FileCheck -check-prefix=CHK-FOPENMP-TARGET-ARCHS %s
17 
18 // CHK-FOPENMP-TARGET-ARCHS: ptxas{{.*}}" "--gpu-name" "sm_60"
19 // CHK-FOPENMP-TARGET-ARCHS: nvlink{{.*}}" "-arch" "sm_60"
20 
21 /// ###########################################################################
22 
23 /// Check -Xopenmp-target -march=sm_35 works as expected when two triples are present.
24 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp \
25 // RUN:          -fopenmp-targets=powerpc64le-ibm-linux-gnu,nvptx64-nvidia-cuda \
26 // RUN:          -Xopenmp-target=nvptx64-nvidia-cuda -march=sm_35 %s 2>&1 \
27 // RUN:   | FileCheck -check-prefix=CHK-FOPENMP-TARGET-COMPILATION %s
28 
29 // CHK-FOPENMP-TARGET-COMPILATION: ptxas{{.*}}" "--gpu-name" "sm_35"
30 // CHK-FOPENMP-TARGET-COMPILATION: nvlink{{.*}}" "-arch" "sm_35"
31 
32 /// ###########################################################################
33 
34 /// Check that -lomptarget-nvptx is passed to nvlink.
35 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp \
36 // RUN:          -fopenmp-targets=nvptx64-nvidia-cuda %s 2>&1 \
37 // RUN:   | FileCheck -check-prefix=CHK-NVLINK %s
38 /// Check that the value of --libomptarget-nvptx-path is forwarded to nvlink.
39 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp \
40 // RUN:          --libomptarget-nvptx-path=/path/to/libomptarget/ \
41 // RUN:          -fopenmp-targets=nvptx64-nvidia-cuda %s 2>&1 \
42 // RUN:   | FileCheck -check-prefixes=CHK-NVLINK,CHK-LIBOMPTARGET-NVPTX-PATH %s
43 
44 // CHK-NVLINK: nvlink
45 // CHK-LIBOMPTARGET-NVPTX-PATH-SAME: "-L/path/to/libomptarget/"
46 // CHK-NVLINK-SAME: "-lomptarget-nvptx"
47 
48 /// ###########################################################################
49 
50 /// Check cubin file generation and usage by nvlink
51 // RUN:   %clang -### -no-canonical-prefixes -target powerpc64le-unknown-linux-gnu -fopenmp=libomp \
52 // RUN:          -fopenmp-targets=nvptx64-nvidia-cuda -save-temps %s 2>&1 \
53 // RUN:   | FileCheck -check-prefix=CHK-CUBIN-NVLINK %s
54 /// Check cubin file generation and usage by nvlink when toolchain has BindArchAction
55 // RUN:   %clang -### -no-canonical-prefixes -target x86_64-apple-darwin17.0.0 -fopenmp=libomp \
56 // RUN:          -fopenmp-targets=nvptx64-nvidia-cuda %s 2>&1 \
57 // RUN:   | FileCheck -check-prefix=CHK-CUBIN-NVLINK %s
58 
59 // CHK-CUBIN-NVLINK: clang{{.*}}" {{.*}}"-fopenmp-is-device" {{.*}}"-o" "[[PTX:.*\.s]]"
60 // CHK-CUBIN-NVLINK-NEXT: ptxas{{.*}}" "--output-file" "[[CUBIN:.*\.cubin]]" {{.*}}"[[PTX]]"
61 // CHK-CUBIN-NVLINK-NEXT: nvlink{{.*}}" {{.*}}"[[CUBIN]]"
62 
63 /// ###########################################################################
64 
65 /// Check unbundlink of assembly file, cubin file generation and usage by nvlink
66 // RUN:   touch %t.s
67 // RUN:   %clang -### -target powerpc64le-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
68 // RUN:          -no-canonical-prefixes -save-temps %t.s 2>&1 \
69 // RUN:   | FileCheck -check-prefix=CHK-UNBUNDLING-PTXAS-CUBIN-NVLINK %s
70 
71 /// Use DAG to ensure that assembly file has been unbundled.
72 // CHK-UNBUNDLING-PTXAS-CUBIN-NVLINK-DAG: ptxas{{.*}}" "--output-file" "[[CUBIN:.*\.cubin]]" {{.*}}"[[PTX:.*\.s]]"
73 // CHK-UNBUNDLING-PTXAS-CUBIN-NVLINK-DAG: clang-offload-bundler{{.*}}" "-type=s" {{.*}}"-outputs={{.*}}[[PTX]]
74 // CHK-UNBUNDLING-PTXAS-CUBIN-NVLINK-DAG-SAME: "-unbundle"
75 // CHK-UNBUNDLING-PTXAS-CUBIN-NVLINK: nvlink{{.*}}" {{.*}}"[[CUBIN]]"
76 
77 /// ###########################################################################
78 
79 /// Check cubin file generation and bundling
80 // RUN:   %clang -### -target powerpc64le-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
81 // RUN:          -no-canonical-prefixes -save-temps %s -c 2>&1 \
82 // RUN:   | FileCheck -check-prefix=CHK-PTXAS-CUBIN-BUNDLING %s
83 
84 // CHK-PTXAS-CUBIN-BUNDLING: clang{{.*}}" "-o" "[[PTX:.*\.s]]"
85 // CHK-PTXAS-CUBIN-BUNDLING-NEXT: ptxas{{.*}}" "--output-file" "[[CUBIN:.*\.cubin]]" {{.*}}"[[PTX]]"
86 // CHK-PTXAS-CUBIN-BUNDLING: clang-offload-bundler{{.*}}" "-type=o" {{.*}}"-inputs={{.*}}[[CUBIN]]
87 
88 /// ###########################################################################
89 
90 /// Check cubin file unbundling and usage by nvlink
91 // RUN:   touch %t.o
92 // RUN:   %clang -### -target powerpc64le-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
93 // RUN:          -no-canonical-prefixes -save-temps %t.o %S/Inputs/in.so 2>&1 \
94 // RUN:   | FileCheck -check-prefix=CHK-CUBIN-UNBUNDLING-NVLINK %s
95 
96 /// Use DAG to ensure that cubin file has been unbundled.
97 // CHK-CUBIN-UNBUNDLING-NVLINK-NOT: clang-offload-bundler{{.*}}" "-type=o"{{.*}}in.so
98 // CHK-CUBIN-UNBUNDLING-NVLINK-DAG: nvlink{{.*}}" {{.*}}"[[CUBIN:.*\.cubin]]"
99 // CHK-CUBIN-UNBUNDLING-NVLINK-DAG: clang-offload-bundler{{.*}}" "-type=o" {{.*}}"-outputs={{.*}}[[CUBIN]]
100 // CHK-CUBIN-UNBUNDLING-NVLINK-DAG-SAME: "-unbundle"
101 // CHK-CUBIN-UNBUNDLING-NVLINK-NOT: clang-offload-bundler{{.*}}" "-type=o"{{.*}}in.so
102 
103 /// ###########################################################################
104 
105 /// Check cubin file generation and usage by nvlink
106 // RUN:   touch %t1.o
107 // RUN:   touch %t2.o
108 // RUN:   %clang -### -no-canonical-prefixes -target powerpc64le-unknown-linux-gnu -fopenmp=libomp \
109 // RUN:          -fopenmp-targets=nvptx64-nvidia-cuda %t1.o %t2.o 2>&1 \
110 // RUN:   | FileCheck -check-prefix=CHK-TWOCUBIN %s
111 /// Check cubin file generation and usage by nvlink when toolchain has BindArchAction
112 // RUN:   %clang -### -no-canonical-prefixes -target x86_64-apple-darwin17.0.0 -fopenmp=libomp \
113 // RUN:          -fopenmp-targets=nvptx64-nvidia-cuda %t1.o %t2.o 2>&1 \
114 // RUN:   | FileCheck -check-prefix=CHK-TWOCUBIN %s
115 
116 // CHK-TWOCUBIN: nvlink{{.*}}openmp-offload-{{.*}}.cubin" "{{.*}}openmp-offload-{{.*}}.cubin"
117 
118 /// ###########################################################################
119 
120 /// Check PTXAS is passed -c flag when offloading to an NVIDIA device using OpenMP.
121 // RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -no-canonical-prefixes %s 2>&1 \
122 // RUN:   | FileCheck -check-prefix=CHK-PTXAS-DEFAULT %s
123 
124 // CHK-PTXAS-DEFAULT: ptxas{{.*}}" "-c"
125 
126 /// ###########################################################################
127 
128 /// PTXAS is passed -c flag by default when offloading to an NVIDIA device using OpenMP - disable it.
129 // RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -fnoopenmp-relocatable-target \
130 // RUN:          -save-temps -no-canonical-prefixes %s 2>&1 \
131 // RUN:   | FileCheck -check-prefix=CHK-PTXAS-NORELO %s
132 
133 // CHK-PTXAS-NORELO-NOT: ptxas{{.*}}" "-c"
134 
135 /// ###########################################################################
136 
137 /// PTXAS is passed -c flag by default when offloading to an NVIDIA device using OpenMP
138 /// Check that the flag is passed when -fopenmp-relocatable-target is used.
139 // RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -fopenmp-relocatable-target \
140 // RUN:          -save-temps -no-canonical-prefixes %s 2>&1 \
141 // RUN:   | FileCheck -check-prefix=CHK-PTXAS-RELO %s
142 
143 // CHK-PTXAS-RELO: ptxas{{.*}}" "-c"
144 
145 /// ###########################################################################
146 
147 /// Check that error is not thrown by toolchain when no cuda lib flag is used.
148 /// Check that the flag is passed when -fopenmp-relocatable-target is used.
149 // RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 \
150 // RUN:   -nocudalib -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \
151 // RUN:   | FileCheck -check-prefix=CHK-FLAG-NOLIBDEVICE %s
152 
153 // CHK-FLAG-NOLIBDEVICE-NOT: error:{{.*}}sm_60
154 
155 /// ###########################################################################
156 
157 /// Check that error is not thrown by toolchain when no cuda lib device is found when using -S.
158 /// Check that the flag is passed when -fopenmp-relocatable-target is used.
159 // RUN:   %clang -### -S -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 \
160 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \
161 // RUN:   | FileCheck -check-prefix=CHK-NOLIBDEVICE %s
162 
163 // CHK-NOLIBDEVICE-NOT: error:{{.*}}sm_60
164 
165 /// ###########################################################################
166 
167 /// Check that the runtime bitcode library is part of the compile line. Create a bogus
168 /// bitcode library and add it to the LIBRARY_PATH.
169 // RUN:   env LIBRARY_PATH=%S/Inputs/libomptarget %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
170 // RUN:   -Xopenmp-target -march=sm_20 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda \
171 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \
172 // RUN:   | FileCheck -check-prefix=CHK-BCLIB %s
173 /// The user can override default detection using --libomptarget-nvptx-path=.
174 // RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda --libomptarget-nvptx-path=%S/Inputs/libomptarget \
175 // RUN:   -Xopenmp-target -march=sm_20 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda \
176 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \
177 // RUN:   | FileCheck -check-prefix=CHK-BCLIB %s
178 
179 // CHK-BCLIB: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-sm_20.bc
180 // CHK-BCLIB-NOT: {{error:|warning:}}
181 
182 /// ###########################################################################
183 
184 /// Check that the warning is thrown when the libomptarget bitcode library is not found.
185 /// Libomptarget requires sm_35 or newer so an sm_20 bitcode library should never exist.
186 // RUN:   %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda \
187 // RUN:   -Xopenmp-target -march=sm_20 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda \
188 // RUN:   -fopenmp-relocatable-target -save-temps -no-canonical-prefixes %s 2>&1 \
189 // RUN:   | FileCheck -check-prefix=CHK-BCLIB-WARN %s
190 
191 // CHK-BCLIB-WARN: No library 'libomptarget-nvptx-sm_20.bc' found in the default clang lib directory or in LIBRARY_PATH. Expect degraded performance due to no inlining of runtime functions on target devices.
192 
193 /// Check that debug info is emitted in dwarf-2
194 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O1 --no-cuda-noopt-device-debug 2>&1 \
195 // RUN:   | FileCheck -check-prefix=DEBUG_DIRECTIVES %s
196 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O3 2>&1 \
197 // RUN:   | FileCheck -check-prefix=DEBUG_DIRECTIVES %s
198 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O3 --no-cuda-noopt-device-debug 2>&1 \
199 // RUN:   | FileCheck -check-prefix=DEBUG_DIRECTIVES %s
200 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g0 2>&1 \
201 // RUN:   | FileCheck -check-prefix=NO_DEBUG %s
202 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -ggdb0 -O3 --cuda-noopt-device-debug 2>&1 \
203 // RUN:   | FileCheck -check-prefix=NO_DEBUG %s
204 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -gline-directives-only 2>&1 \
205 // RUN:   | FileCheck -check-prefix=DEBUG_DIRECTIVES %s
206 
207 // DEBUG_DIRECTIVES-NOT: warning: debug
208 // NO_DEBUG-NOT: warning: debug
209 // NO_DEBUG: "-fopenmp-is-device"
210 // NO_DEBUG-NOT: "-debug-info-kind=
211 // NO_DEBUG: ptxas
212 // DEBUG_DIRECTIVES: "-triple" "nvptx64-nvidia-cuda"
213 // DEBUG_DIRECTIVES-SAME: "-debug-info-kind=line-directives-only"
214 // DEBUG_DIRECTIVES-SAME: "-fopenmp-is-device"
215 // DEBUG_DIRECTIVES: ptxas
216 // DEBUG_DIRECTIVES: "-lineinfo"
217 // NO_DEBUG-NOT: "-g"
218 // NO_DEBUG: nvlink
219 // NO_DEBUG-NOT: "-g"
220 
221 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O0 --no-cuda-noopt-device-debug 2>&1 \
222 // RUN:   | FileCheck -check-prefix=HAS_DEBUG %s
223 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g 2>&1 \
224 // RUN:   | FileCheck -check-prefix=HAS_DEBUG %s
225 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O0 --cuda-noopt-device-debug 2>&1 \
226 // RUN:   | FileCheck -check-prefix=HAS_DEBUG %s
227 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g -O3 --cuda-noopt-device-debug 2>&1 \
228 // RUN:   | FileCheck -check-prefix=HAS_DEBUG %s
229 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g2 2>&1 \
230 // RUN:   | FileCheck -check-prefix=HAS_DEBUG %s
231 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -ggdb2 -O0 --cuda-noopt-device-debug 2>&1 \
232 // RUN:   | FileCheck -check-prefix=HAS_DEBUG %s
233 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -g3 -O3 --cuda-noopt-device-debug 2>&1 \
234 // RUN:   | FileCheck -check-prefix=HAS_DEBUG %s
235 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -ggdb3 -O2 --cuda-noopt-device-debug 2>&1 \
236 // RUN:   | FileCheck -check-prefix=HAS_DEBUG %s
237 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -gline-tables-only 2>&1 \
238 // RUN:   | FileCheck -check-prefix=HAS_DEBUG %s
239 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -ggdb1 -O2 --cuda-noopt-device-debug 2>&1 \
240 // RUN:   | FileCheck -check-prefix=HAS_DEBUG %s
241 
242 // HAS_DEBUG-NOT: warning: debug
243 // HAS_DEBUG: "-triple" "nvptx64-nvidia-cuda"
244 // HAS_DEBUG-SAME: "-debug-info-kind={{limited|line-tables-only}}"
245 // HAS_DEBUG-SAME: "-dwarf-version=2"
246 // HAS_DEBUG-SAME: "-fopenmp-is-device"
247 // HAS_DEBUG: ptxas
248 // HAS_DEBUG-SAME: "-g"
249 // HAS_DEBUG-SAME: "--dont-merge-basicblocks"
250 // HAS_DEBUG-SAME: "--return-at-end"
251 // HAS_DEBUG: nvlink
252 // HAS_DEBUG-SAME: "-g"
253 
254 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fopenmp-cuda-mode 2>&1 \
255 // RUN:   | FileCheck -check-prefix=CUDA_MODE %s
256 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fno-openmp-cuda-mode -fopenmp-cuda-mode 2>&1 \
257 // RUN:   | FileCheck -check-prefix=CUDA_MODE %s
258 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target -march=gfx906 %s -fopenmp-cuda-mode 2>&1 \
259 // RUN:   | FileCheck -check-prefix=CUDA_MODE %s
260 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target -march=gfx906 %s -fno-openmp-cuda-mode -fopenmp-cuda-mode 2>&1 \
261 // RUN:   | FileCheck -check-prefix=CUDA_MODE %s
262 // CUDA_MODE: clang{{.*}}"-cc1"{{.*}}"-triple" "{{nvptx64-nvidia-cuda|amdgcn-amd-amdhsa}}"
263 // CUDA_MODE-SAME: "-fopenmp-cuda-mode"
264 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fno-openmp-cuda-mode 2>&1 \
265 // RUN:   | FileCheck -check-prefix=NO_CUDA_MODE %s
266 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fopenmp-cuda-mode -fno-openmp-cuda-mode 2>&1 \
267 // RUN:   | FileCheck -check-prefix=NO_CUDA_MODE %s
268 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target -march=gfx906 %s -fno-openmp-cuda-mode 2>&1 \
269 // RUN:   | FileCheck -check-prefix=NO_CUDA_MODE %s
270 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target -march=gfx906 %s -fopenmp-cuda-mode -fno-openmp-cuda-mode 2>&1 \
271 // RUN:   | FileCheck -check-prefix=NO_CUDA_MODE %s
272 // NO_CUDA_MODE-NOT: "-{{fno-|f}}openmp-cuda-mode"
273 
274 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fopenmp-cuda-force-full-runtime 2>&1 \
275 // RUN:   | FileCheck -check-prefix=FULL_RUNTIME %s
276 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fno-openmp-cuda-force-full-runtime -fopenmp-cuda-force-full-runtime 2>&1 \
277 // RUN:   | FileCheck -check-prefix=FULL_RUNTIME %s
278 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target -march=gfx906 %s -fopenmp-cuda-force-full-runtime 2>&1 \
279 // RUN:   | FileCheck -check-prefix=FULL_RUNTIME %s
280 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target -march=gfx906 %s -fno-openmp-cuda-force-full-runtime -fopenmp-cuda-force-full-runtime 2>&1 \
281 // RUN:   | FileCheck -check-prefix=FULL_RUNTIME %s
282 // FULL_RUNTIME: clang{{.*}}"-cc1"{{.*}}"-triple" "{{nvptx64-nvidia-cuda|amdgcn-amd-amdhsa}}"
283 // FULL_RUNTIME-SAME: "-fopenmp-cuda-force-full-runtime"
284 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fno-openmp-cuda-force-full-runtime 2>&1 \
285 // RUN:   | FileCheck -check-prefix=NO_FULL_RUNTIME %s
286 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fopenmp-cuda-force-full-runtime -fno-openmp-cuda-force-full-runtime 2>&1 \
287 // RUN:   | FileCheck -check-prefix=NO_FULL_RUNTIME %s
288 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target -march=gfx906 %s -fno-openmp-cuda-force-full-runtime 2>&1 \
289 // RUN:   | FileCheck -check-prefix=NO_FULL_RUNTIME %s
290 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target -march=gfx906 %s -fopenmp-cuda-force-full-runtime -fno-openmp-cuda-force-full-runtime 2>&1 \
291 // RUN:   | FileCheck -check-prefix=NO_FULL_RUNTIME %s
292 // NO_FULL_RUNTIME-NOT: "-{{fno-|f}}openmp-cuda-force-full-runtime"
293 
294 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target -march=sm_60 %s -fopenmp-cuda-teams-reduction-recs-num=2048 2>&1 \
295 // RUN:   | FileCheck -check-prefix=CUDA_RED_RECS %s
296 // CUDA_RED_RECS: clang{{.*}}"-cc1"{{.*}}"-triple" "nvptx64-nvidia-cuda"
297 // CUDA_RED_RECS-SAME: "-fopenmp-cuda-teams-reduction-recs-num=2048"
298 
299 // RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda %s 2>&1 \
300 // RUN:   | FileCheck -check-prefix=OPENMP_NVPTX_WRAPPERS %s
301 // OPENMP_NVPTX_WRAPPERS: clang{{.*}}"-cc1"{{.*}}"-triple" "nvptx64-nvidia-cuda"
302 // OPENMP_NVPTX_WRAPPERS-SAME: "-internal-isystem" "{{.*}}openmp_wrappers"
303