1 // REQUIRES: x86-registered-target 2 // REQUIRES: nvptx-registered-target 3 // REQUIRES: amdgpu-registered-target 4 5 // REQUIRES: system-linux 6 7 // An externally visible variable so static libraries extract. 8 __attribute__((visibility("protected"), used)) int x; 9 10 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.elf.o 11 // RUN: %clang -cc1 %s -triple nvptx64-nvidia-cuda -emit-llvm-bc -o %t.nvptx.bc 12 // RUN: %clang -cc1 %s -triple amdgcn-amd-amdhsa -emit-llvm-bc -o %t.amdgpu.bc 13 14 // RUN: clang-offload-packager -o %t.out \ 15 // RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 \ 16 // RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 17 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out 18 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ 19 // RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=NVPTX-LINK 20 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o %t.o -fembed-offload-object=%t.out 21 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ 22 // RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=NVPTX-LINK 23 24 // NVPTX-LINK: clang{{.*}} -o {{.*}}.img --target=nvptx64-nvidia-cuda -march=sm_70 -O2 -flto {{.*}}.o {{.*}}.o 25 26 // RUN: clang-offload-packager -o %t.out \ 27 // RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 \ 28 // RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 29 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out 30 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run --device-debug -O0 \ 31 // RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=NVPTX-LINK-DEBUG 32 33 // NVPTX-LINK-DEBUG: clang{{.*}} -o {{.*}}.img --target=nvptx64-nvidia-cuda -march=sm_70 -O2 -flto {{.*}}.o {{.*}}.o -g 34 35 // RUN: clang-offload-packager -o %t.out \ 36 // RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 \ 37 // RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 38 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out 39 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ 40 // RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=AMDGPU-LINK 41 42 // AMDGPU-LINK: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx908 -O2 -flto -Wl,--no-undefined {{.*}}.o {{.*}}.o 43 44 // RUN: clang-offload-packager -o %t.out \ 45 // RUN: --image=file=%t.amdgpu.bc,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx1030 \ 46 // RUN: --image=file=%t.amdgpu.bc,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx1030 47 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out 48 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run --save-temps -O2 \ 49 // RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=AMDGPU-LTO-TEMPS 50 51 // AMDGPU-LTO-TEMPS: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx1030 -O2 -flto -Wl,--no-undefined {{.*}}.o -save-temps 52 53 // RUN: clang-offload-packager -o %t.out \ 54 // RUN: --image=file=%t.elf.o,kind=openmp,triple=x86_64-unknown-linux-gnu \ 55 // RUN: --image=file=%t.elf.o,kind=openmp,triple=x86_64-unknown-linux-gnu 56 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out 57 // RUN: llvm-ar rcs %t.a %t.o 58 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ 59 // RUN: --linker-path=/usr/bin/ld.lld --whole-archive %t.a --no-whole-archive \ 60 // RUN: %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=CPU-LINK 61 62 // CPU-LINK: clang{{.*}} -o {{.*}}.img --target=x86_64-unknown-linux-gnu -march=native -O2 -flto -Wl,--no-undefined {{.*}}.o {{.*}}.o -Wl,-Bsymbolic -shared -Wl,--whole-archive {{.*}}.a -Wl,--no-whole-archive 63 64 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o 65 // RUN: clang-linker-wrapper --dry-run --host-triple=x86_64-unknown-linux-gnu -mllvm -openmp-opt-disable \ 66 // RUN: --linker-path=/usr/bin/ld.lld -a -b -c %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=HOST-LINK 67 68 // HOST-LINK: ld.lld{{.*}}-a -b -c {{.*}}.o -o a.out 69 // HOST-LINK-NOT: ld.lld{{.*}}-abc 70 71 // RUN: clang-offload-packager -o %t-lib.out \ 72 // RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 \ 73 // RUN: --image=file=%t.elf.o,kind=cuda,triple=nvptx64-nvidia-cuda,arch=sm_52 74 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t-lib.out 75 // RUN: llvm-ar rcs %t.a %t.o 76 // RUN: clang-offload-packager -o %t.out \ 77 // RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 78 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t-obj.o -fembed-offload-object=%t.out 79 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ 80 // RUN: --linker-path=/usr/bin/ld %t.a %t-obj.o -o a.out 2>&1 | FileCheck %s --check-prefix=STATIC-LIBRARY 81 82 // STATIC-LIBRARY: clang{{.*}} -march=sm_70 83 // STATIC-LIBRARY-NOT: clang{{.*}} -march=sm_50 84 85 // RUN: clang-offload-packager -o %t.out \ 86 // RUN: --image=file=%t.elf.o,kind=cuda,triple=nvptx64-nvidia-cuda,arch=sm_70 \ 87 // RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 \ 88 // RUN: --image=file=%t.elf.o,kind=cuda,triple=nvptx64-nvidia-cuda,arch=sm_52 89 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o \ 90 // RUN: -fembed-offload-object=%t.out 91 // RUN: clang-linker-wrapper --dry-run --host-triple=x86_64-unknown-linux-gnu \ 92 // RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=CUDA 93 94 // CUDA: clang{{.*}} -o [[IMG_SM70:.+]] --target=nvptx64-nvidia-cuda -march=sm_70 95 // CUDA: clang{{.*}} -o [[IMG_SM52:.+]] --target=nvptx64-nvidia-cuda -march=sm_52 96 // CUDA: fatbinary{{.*}}-64 --create {{.*}}.fatbin --image=profile=sm_70,file=[[IMG_SM70]] --image=profile=sm_52,file=[[IMG_SM52]] 97 // CUDA: usr/bin/ld{{.*}} {{.*}}.openmp.image.{{.*}}.o {{.*}}.cuda.image.{{.*}}.o 98 99 // RUN: clang-offload-packager -o %t.out \ 100 // RUN: --image=file=%t.elf.o,kind=cuda,triple=nvptx64-nvidia-cuda,arch=sm_80 \ 101 // RUN: --image=file=%t.elf.o,kind=cuda,triple=nvptx64-nvidia-cuda,arch=sm_75 \ 102 // RUN: --image=file=%t.elf.o,kind=cuda,triple=nvptx64-nvidia-cuda,arch=sm_70 \ 103 // RUN: --image=file=%t.elf.o,kind=cuda,triple=nvptx64-nvidia-cuda,arch=sm_52 104 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o \ 105 // RUN: -fembed-offload-object=%t.out 106 // RUN: clang-linker-wrapper --dry-run --host-triple=x86_64-unknown-linux-gnu --wrapper-jobs=4 \ 107 // RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=CUDA-PAR 108 109 // CUDA-PAR: fatbinary{{.*}}-64 --create {{.*}}.fatbin 110 111 // RUN: clang-offload-packager -o %t.out \ 112 // RUN: --image=file=%t.elf.o,kind=hip,triple=amdgcn-amd-amdhsa,arch=gfx90a \ 113 // RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx90a \ 114 // RUN: --image=file=%t.elf.o,kind=hip,triple=amdgcn-amd-amdhsa,arch=gfx908 115 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o \ 116 // RUN: -fembed-offload-object=%t.out 117 // RUN: clang-linker-wrapper --dry-run --host-triple=x86_64-unknown-linux-gnu \ 118 // RUN: --compress --compression-level=6 \ 119 // RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=HIP 120 121 // HIP: clang{{.*}} -o [[IMG_GFX90A:.+]] --target=amdgcn-amd-amdhsa -mcpu=gfx90a 122 // HIP: clang{{.*}} -o [[IMG_GFX908:.+]] --target=amdgcn-amd-amdhsa -mcpu=gfx908 123 // HIP: clang-offload-bundler{{.*}}-type=o -bundle-align=4096 -compress -compression-level=6 -targets=host-x86_64-unknown-linux-gnu,hip-amdgcn-amd-amdhsa--gfx90a,hip-amdgcn-amd-amdhsa--gfx908 -input=/dev/null -input=[[IMG_GFX90A]] -input=[[IMG_GFX908]] -output={{.*}}.hipfb 124 125 // RUN: clang-offload-packager -o %t.out \ 126 // RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 \ 127 // RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 128 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o \ 129 // RUN: -fembed-offload-object=%t.out 130 // RUN: clang-linker-wrapper --dry-run --host-triple=x86_64-unknown-linux-gnu \ 131 // RUN: --linker-path=/usr/bin/ld --device-linker=foo=bar --device-linker=a \ 132 // RUN: --device-linker=nvptx64-nvidia-cuda=b --device-compiler=foo\ 133 // RUN: %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=LINKER-ARGS 134 135 // LINKER-ARGS: clang{{.*}}--target=amdgcn-amd-amdhsa{{.*}}-Xlinker foo=bar{{.*}}-Xlinker a{{.*}}foo 136 // LINKER-ARGS: clang{{.*}}--target=nvptx64-nvidia-cuda{{.*}}-Xlinker foo=bar{{.*}}-Xlinker a -Xlinker b{{.*}}foo 137 138 // RUN: not clang-linker-wrapper --dry-run --host-triple=x86_64-unknown-linux-gnu \ 139 // RUN: -ldummy --linker-path=/usr/bin/ld \ 140 // RUN: -o a.out 2>&1 | FileCheck %s --check-prefix=MISSING-LIBRARY 141 142 // MISSING-LIBRARY: error: unable to find library -ldummy 143 144 // RUN: clang-offload-packager -o %t.out \ 145 // RUN: --image=file=%t.amdgpu.bc,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 \ 146 // RUN: --image=file=%t.amdgpu.bc,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 147 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out 148 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run --clang-backend \ 149 // RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=CLANG-BACKEND 150 151 // CLANG-BACKEND: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx908 -O2 -flto -Wl,--no-undefined {{.*}}.o 152 153 // RUN: clang-offload-packager -o %t.out \ 154 // RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 155 // RUN: %clang -cc1 %s -triple x86_64-unknown-windows-msvc -emit-obj -o %t.o -fembed-offload-object=%t.out 156 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-windows-msvc --dry-run \ 157 // RUN: --linker-path=/usr/bin/lld-link %t.o -libpath:./ -out:a.exe 2>&1 | FileCheck %s --check-prefix=COFF 158 159 // COFF: "/usr/bin/lld-link" {{.*}}.o -libpath:./ -out:a.exe {{.*}}openmp.image.wrapper{{.*}} 160 161 // RUN: clang-offload-packager -o %t-lib.out \ 162 // RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx90a 163 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t-lib.out 164 // RUN: llvm-ar rcs %t.a %t.o 165 // RUN: clang-offload-packager -o %t-on.out \ 166 // RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx90a:xnack+ 167 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t-on.o -fembed-offload-object=%t-on.out 168 // RUN: clang-offload-packager -o %t-off.out \ 169 // RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx90a:xnack- 170 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t-off.o -fembed-offload-object=%t-off.out 171 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ 172 // RUN: --linker-path=/usr/bin/ld %t-on.o %t-off.o %t.a -o a.out 2>&1 | FileCheck %s --check-prefix=AMD-TARGET-ID 173 174 // AMD-TARGET-ID: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx90a:xnack+ -O2 -flto -Wl,--no-undefined {{.*}}.o {{.*}}.o 175 // AMD-TARGET-ID: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx90a:xnack- -O2 -flto -Wl,--no-undefined {{.*}}.o {{.*}}.o 176 177 // RUN: clang-offload-packager -o %t-lib.out \ 178 // RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=generic 179 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t-lib.out 180 // RUN: llvm-ar rcs %t.a %t.o 181 // RUN: clang-offload-packager -o %t1.out \ 182 // RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx90a 183 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t1.o -fembed-offload-object=%t1.out 184 // RUN: clang-offload-packager -o %t2.out \ 185 // RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 186 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t2.o -fembed-offload-object=%t2.out 187 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ 188 // RUN: --linker-path=/usr/bin/ld %t1.o %t2.o %t.a -o a.out 2>&1 | FileCheck %s --check-prefix=ARCH-ALL 189 190 // ARCH-ALL: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx90a -O2 -flto -Wl,--no-undefined {{.*}}.o {{.*}}.o 191 // ARCH-ALL: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx908 -O2 -flto -Wl,--no-undefined {{.*}}.o {{.*}}.o 192 193 // RUN: clang-offload-packager -o %t.out \ 194 // RUN: --image=file=%t.elf.o,kind=openmp,triple=x86_64-unknown-linux-gnu \ 195 // RUN: --image=file=%t.elf.o,kind=openmp,triple=x86_64-unknown-linux-gnu 196 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out 197 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ 198 // RUN: --linker-path=/usr/bin/ld.lld -r %t.o \ 199 // RUN: %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=RELOCATABLE-LINK 200 201 // RELOCATABLE-LINK: clang{{.*}} -o {{.*}}.img --target=x86_64-unknown-linux-gnu 202 // RELOCATABLE-LINK: /usr/bin/ld.lld{{.*}}-r 203 // RELOCATABLE-LINK: llvm-objcopy{{.*}}a.out --remove-section .llvm.offloading 204 205 // RUN: clang-offload-packager -o %t.out \ 206 // RUN: --image=file=%t.elf.o,kind=hip,triple=amdgcn-amd-amdhsa,arch=gfx90a \ 207 // RUN: --image=file=%t.elf.o,kind=hip,triple=amdgcn-amd-amdhsa,arch=gfx90a 208 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out 209 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ 210 // RUN: --linker-path=/usr/bin/ld.lld -r %t.o \ 211 // RUN: %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=RELOCATABLE-LINK-HIP 212 213 // RELOCATABLE-LINK-HIP: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa 214 // RELOCATABLE-LINK-HIP: clang-offload-bundler{{.*}} -type=o -bundle-align=4096 -targets=host-x86_64-unknown-linux-gnu,hip-amdgcn-amd-amdhsa--gfx90a -input=/dev/null -input={{.*}} -output={{.*}} 215 // RELOCATABLE-LINK-HIP: /usr/bin/ld.lld{{.*}}-r 216 // RELOCATABLE-LINK-HIP: llvm-objcopy{{.*}}a.out --remove-section .llvm.offloading 217 218 // RUN: clang-offload-packager -o %t.out \ 219 // RUN: --image=file=%t.elf.o,kind=cuda,triple=nvptx64-nvidia-cuda,arch=sm_89 \ 220 // RUN: --image=file=%t.elf.o,kind=cuda,triple=nvptx64-nvidia-cuda,arch=sm_89 221 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out 222 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ 223 // RUN: --linker-path=/usr/bin/ld.lld -r %t.o \ 224 // RUN: %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=RELOCATABLE-LINK-CUDA 225 226 // RELOCATABLE-LINK-CUDA: clang{{.*}} -o {{.*}}.img --target=nvptx64-nvidia-cuda 227 // RELOCATABLE-LINK-CUDA: fatbinary{{.*}} -64 --create {{.*}}.fatbin --image=profile=sm_89,file={{.*}}.img 228 // RELOCATABLE-LINK-CUDA: /usr/bin/ld.lld{{.*}}-r 229 // RELOCATABLE-LINK-CUDA: llvm-objcopy{{.*}}a.out --remove-section .llvm.offloading 230 231 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o 232 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ 233 // RUN: --linker-path=/usr/bin/ld --override=image=openmp=%t.o %t.o -o a.out 2>&1 \ 234 // RUN: | FileCheck %s --check-prefix=OVERRIDE 235 // OVERRIDE-NOT: clang 236 // OVERRIDE: /usr/bin/ld 237 238 // RUN: clang-offload-packager -o %t.out \ 239 // RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 240 // RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out 241 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ 242 // RUN: --offload-opt=-pass-remarks=foo,bar --linker-path=/usr/bin/ld \ 243 // RUN: %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=OFFLOAD-OPT 244 // RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ 245 // RUN: -mllvm -pass-remarks=foo,bar --linker-path=/usr/bin/ld \ 246 // RUN: %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=MLLVM 247 248 // MLLVM: clang{{.*}}-Xlinker --plugin-opt=-pass-remarks=foo,bar 249 // OFFLOAD-OPT: clang{{.*}}-Xlinker --plugin-opt=-pass-remarks=foo,bar 250 // MLLVM-SAME: -Xlinker -mllvm=-pass-remarks=foo,bar 251 // OFFLOAD-OPT-NOT: -Xlinker -mllvm=-pass-remarks=foo,bar 252 // OFFLOAD-OPT-SAME: {{$}} 253 254 // Error handling when --linker-path is not provided for clang-linker-wrapper 255 // RUN: not clang-linker-wrapper 2>&1 | FileCheck --check-prefix=LINKER-PATH-NOT-PROVIDED %s 256 // LINKER-PATH-NOT-PROVIDED: linker path missing, must pass 'linker-path' 257