| 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 {{.*}}.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 {{.*}}.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 -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 -Wl,--no-undefined {{.*}}.s -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 -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,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=a --device-linker=nvptx64-nvidia-cuda=b \ |
| 132 |
// RUN: %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=LINKER-ARGS |
| 133 |
|
| 134 |
// LINKER-ARGS: clang{{.*}}--target=amdgcn-amd-amdhsa{{.*}}a |
| 135 |
// LINKER-ARGS: clang{{.*}}--target=nvptx64-nvidia-cuda{{.*}}a b |
| 136 |
|
| 137 |
// RUN: not clang-linker-wrapper --dry-run --host-triple=x86_64-unknown-linux-gnu -ldummy \ |
| 138 |
// RUN: --linker-path=/usr/bin/ld --device-linker=a --device-linker=nvptx64-nvidia-cuda=b \ |
| 139 |
// RUN: -o a.out 2>&1 | FileCheck %s --check-prefix=MISSING-LIBRARY |
| 140 |
|
| 141 |
// MISSING-LIBRARY: error: unable to find library -ldummy |
| 142 |
|
| 143 |
// RUN: clang-offload-packager -o %t.out \ |
| 144 |
// RUN: --image=file=%t.amdgpu.bc,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 \ |
| 145 |
// RUN: --image=file=%t.amdgpu.bc,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 |
| 146 |
// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out |
| 147 |
// RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run --clang-backend \ |
| 148 |
// RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=CLANG-BACKEND |
| 149 |
|
| 150 |
// CLANG-BACKEND: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx908 -O2 -Wl,--no-undefined {{.*}}.bc |
| 151 |
|
| 152 |
// RUN: clang-offload-packager -o %t.out \ |
| 153 |
// RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 |
| 154 |
// RUN: %clang -cc1 %s -triple x86_64-unknown-windows-msvc -emit-obj -o %t.o -fembed-offload-object=%t.out |
| 155 |
// RUN: clang-linker-wrapper --host-triple=x86_64-unknown-windows-msvc --dry-run \ |
| 156 |
// RUN: --linker-path=/usr/bin/lld-link %t.o -libpath:./ -out:a.exe 2>&1 | FileCheck %s --check-prefix=COFF |
| 157 |
|
| 158 |
// COFF: "/usr/bin/lld-link" {{.*}}.o -libpath:./ -out:a.exe {{.*}}openmp.image.wrapper{{.*}} |
| 159 |
|
| 160 |
// RUN: clang-offload-packager -o %t-lib.out \ |
| 161 |
// RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx90a |
| 162 |
// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t-lib.out |
| 163 |
// RUN: llvm-ar rcs %t.a %t.o |
| 164 |
// RUN: clang-offload-packager -o %t-on.out \ |
| 165 |
// RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx90a:xnack+ |
| 166 |
// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t-on.o -fembed-offload-object=%t-on.out |
| 167 |
// RUN: clang-offload-packager -o %t-off.out \ |
| 168 |
// RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx90a:xnack- |
| 169 |
// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t-off.o -fembed-offload-object=%t-off.out |
| 170 |
// RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ |
| 171 |
// 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 |
| 172 |
|
| 173 |
// AMD-TARGET-ID: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx90a:xnack+ -O2 -Wl,--no-undefined {{.*}}.o {{.*}}.o |
| 174 |
// AMD-TARGET-ID: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx90a:xnack- -O2 -Wl,--no-undefined {{.*}}.o {{.*}}.o |
| 175 |
|
| 176 |
// RUN: clang-offload-packager -o %t-lib.out \ |
| 177 |
// RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=generic |
| 178 |
// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t-lib.out |
| 179 |
// RUN: llvm-ar rcs %t.a %t.o |
| 180 |
// RUN: clang-offload-packager -o %t1.out \ |
| 181 |
// RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx90a |
| 182 |
// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t1.o -fembed-offload-object=%t1.out |
| 183 |
// RUN: clang-offload-packager -o %t2.out \ |
| 184 |
// RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 |
| 185 |
// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t2.o -fembed-offload-object=%t2.out |
| 186 |
// RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ |
| 187 |
// RUN: --linker-path=/usr/bin/ld %t1.o %t2.o %t.a -o a.out 2>&1 | FileCheck %s --check-prefix=ARCH-ALL |
| 188 |
|
| 189 |
// ARCH-ALL: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx90a -O2 -Wl,--no-undefined {{.*}}.o {{.*}}.o |
| 190 |
// ARCH-ALL: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx908 -O2 -Wl,--no-undefined {{.*}}.o {{.*}}.o |
| 191 |
|
| 192 |
// RUN: clang-offload-packager -o %t.out \ |
| 193 |
// RUN: --image=file=%t.elf.o,kind=openmp,triple=x86_64-unknown-linux-gnu \ |
| 194 |
// RUN: --image=file=%t.elf.o,kind=openmp,triple=x86_64-unknown-linux-gnu |
| 195 |
// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out |
| 196 |
// RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ |
| 197 |
// RUN: --linker-path=/usr/bin/ld.lld -r %t.o \ |
| 198 |
// RUN: %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=RELOCATABLE-LINK |
| 199 |
|
| 200 |
// RELOCATABLE-LINK: clang{{.*}} -o {{.*}}.img --target=x86_64-unknown-linux-gnu |
| 201 |
// RELOCATABLE-LINK: /usr/bin/ld.lld{{.*}}-r |
| 202 |
// RELOCATABLE-LINK: llvm-objcopy{{.*}}a.out --remove-section .llvm.offloading |
| 203 |
|
| 204 |
// RUN: clang-offload-packager -o %t.out \ |
| 205 |
// RUN: --image=file=%t.elf.o,kind=hip,triple=amdgcn-amd-amdhsa,arch=gfx90a \ |
| 206 |
// RUN: --image=file=%t.elf.o,kind=hip,triple=amdgcn-amd-amdhsa,arch=gfx90a |
| 207 |
// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out |
| 208 |
// RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ |
| 209 |
// RUN: --linker-path=/usr/bin/ld.lld -r %t.o \ |
| 210 |
// RUN: %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=RELOCATABLE-LINK-HIP |
| 211 |
|
| 212 |
// RELOCATABLE-LINK-HIP: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa |
| 213 |
// RELOCATABLE-LINK-HIP: clang-offload-bundler{{.*}} -type=o -bundle-align=4096 -targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa--gfx90a -input=/dev/null -input={{.*}} -output={{.*}} |
| 214 |
// RELOCATABLE-LINK-HIP: /usr/bin/ld.lld{{.*}}-r |
| 215 |
// RELOCATABLE-LINK-HIP: llvm-objcopy{{.*}}a.out --remove-section .llvm.offloading |
| 216 |
|
| 217 |
// RUN: clang-offload-packager -o %t.out \ |
| 218 |
// RUN: --image=file=%t.elf.o,kind=cuda,triple=nvptx64-nvidia-cuda,arch=sm_89 \ |
| 219 |
// RUN: --image=file=%t.elf.o,kind=cuda,triple=nvptx64-nvidia-cuda,arch=sm_89 |
| 220 |
// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out |
| 221 |
// RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ |
| 222 |
// RUN: --linker-path=/usr/bin/ld.lld -r %t.o \ |
| 223 |
// RUN: %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=RELOCATABLE-LINK-CUDA |
| 224 |
|
| 225 |
// RELOCATABLE-LINK-CUDA: clang{{.*}} -o {{.*}}.img --target=nvptx64-nvidia-cuda |
| 226 |
// RELOCATABLE-LINK-CUDA: fatbinary{{.*}} -64 --create {{.*}}.fatbin --image=profile=sm_89,file={{.*}}.img |
| 227 |
// RELOCATABLE-LINK-CUDA: /usr/bin/ld.lld{{.*}}-r |
| 228 |
// RELOCATABLE-LINK-CUDA: llvm-objcopy{{.*}}a.out --remove-section .llvm.offloading |
| 229 |
|
| 230 |
// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o |
| 231 |
// RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \ |
| 232 |
// RUN: --linker-path=/usr/bin/ld --override=image=openmp=%t.o %t.o -o a.out 2>&1 \ |
| 233 |
// RUN: | FileCheck %s --check-prefix=OVERRIDE |
| 234 |
// OVERRIDE-NOT: clang |
| 235 |
// OVERRIDE: /usr/bin/ld |