| 1 |
// -fgpu-rdc link with output |
| 2 |
// RUN: rm -rf %t && mkdir %t |
| 3 |
// RUN: touch %t/obj1.o |
| 4 |
// RUN: touch %t/obj2.o |
| 5 |
// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \ |
| 6 |
// RUN: --hip-link -o executable -fgpu-rdc --cuda-gpu-arch=gfx900 \ |
| 7 |
// RUN: --no-offload-new-driver --offload-arch=gfx906 %t/obj1.o %t/obj2.o 2>&1 | \ |
| 8 |
// RUN: FileCheck -check-prefixes=CHECK,OUT %s |
| 9 |
|
| 10 |
// -fgpu-rdc link without output |
| 11 |
// RUN: touch %t/obj1.o |
| 12 |
// RUN: touch %t/obj2.o |
| 13 |
// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \ |
| 14 |
// RUN: --no-offload-new-driver --hip-link -fgpu-rdc --cuda-gpu-arch=gfx900 \ |
| 15 |
// RUN: --offload-arch=gfx906 %t/obj1.o %t/obj2.o 2>&1 | \ |
| 16 |
// RUN: FileCheck -check-prefixes=CHECK,NOUT %s |
| 17 |
|
| 18 |
// -fgpu-rdc link with output and --emit-static-lib |
| 19 |
// RUN: touch %t/obj1.o |
| 20 |
// RUN: touch %t/obj2.o |
| 21 |
// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \ |
| 22 |
// RUN: --hip-link -o libTest.a -fgpu-rdc --cuda-gpu-arch=gfx900 \ |
| 23 |
// RUN: --no-offload-new-driver --emit-static-lib \ |
| 24 |
// RUN: --offload-arch=gfx906 %t/obj1.o %t/obj2.o 2>&1 | \ |
| 25 |
// RUN: FileCheck -check-prefixes=CHECK,SLO %s |
| 26 |
|
| 27 |
// -fgpu-rdc link without output and --emit-static-lib |
| 28 |
// RUN: touch %t/obj1.o |
| 29 |
// RUN: touch %t/obj2.o |
| 30 |
// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -save-temps \ |
| 31 |
// RUN: --hip-link -fgpu-rdc --cuda-gpu-arch=gfx900 \ |
| 32 |
// RUN: --no-offload-new-driver --emit-static-lib \ |
| 33 |
// RUN: --offload-arch=gfx906 %t/obj1.o %t/obj2.o 2>&1 | \ |
| 34 |
// RUN: FileCheck -check-prefixes=CHECK,SLNO %s |
| 35 |
|
| 36 |
// CHECK: "{{.*clang-offload-bundler.*}}" {{.*}} "-output=obj1-host-x86_64-unknown-linux-gnu.o" "-output=obj1-hip-amdgcn-amd-amdhsa-gfx900.o" "-output=obj1-hip-amdgcn-amd-amdhsa-gfx906.o" "-unbundle" |
| 37 |
// CHECK: "{{.*clang-offload-bundler.*}}" {{.*}} "-output=obj2-host-x86_64-unknown-linux-gnu.o" "-output=obj2-hip-amdgcn-amd-amdhsa-gfx900.o" "-output=obj2-hip-amdgcn-amd-amdhsa-gfx906.o" "-unbundle" |
| 38 |
// CHECK-NOT: {{".*/llvm-link"}} |
| 39 |
// CHECK-NOT: {{".*/opt"}} |
| 40 |
// CHECK-NOT: {{".*/llc"}} |
| 41 |
// CHECK: "{{.*lld.*}}" {{.*}} "-plugin-opt=-amdgpu-internalize-symbols" |
| 42 |
// CHECK-SAME: "-o" "[[HIPFB1:.+]]" "obj1-hip-amdgcn-amd-amdhsa-gfx900.o" "obj2-hip-amdgcn-amd-amdhsa-gfx900.o" |
| 43 |
// CHECK: "{{.*lld.*}}" {{.*}} "-plugin-opt=-amdgpu-internalize-symbols" |
| 44 |
// CHECK-SAME: "-o" "[[HIPFB2:.+]]" "obj1-hip-amdgcn-amd-amdhsa-gfx906.o" "obj2-hip-amdgcn-amd-amdhsa-gfx906.o" |
| 45 |
// CHECK: "{{.*clang.*}}" "-target" "x86_64-unknown-linux-gnu" "-o" "[[OBJBUNDLE:.+.o]]" "-x" "assembler" "{{.*}}.mcin" "-c" |
| 46 |
// OUT: "{{.*ld.*}}" {{.*}} "-o" "executable" {{.*}} "[[OBJBUNDLE]]" |
| 47 |
// NOUT: "{{.*ld.*}}" {{.*}} "-o" "a.out" {{.*}} "[[OBJBUNDLE]]" |
| 48 |
// SLO: "{{.*llvm-ar.*}}" "rcsD" "libTest.a" {{.*}} "[[OBJBUNDLE]]" |
| 49 |
// SLNO: "{{.*llvm-ar.*}}" "rcsD" "a.out" {{.*}} "[[OBJBUNDLE]]" |