|
| 1 | +// REQUIRES: clang-driver |
| 2 | +// REQUIRES: x86-registered-target |
| 3 | +// REQUIRES: amdgpu-registered-target |
| 4 | + |
| 5 | +// If -emit-llvm and/or -S is used in device only compilation, |
| 6 | +// the output should not be bundled. |
| 7 | + |
| 8 | +// RUN: %clang -c -emit-llvm --cuda-device-only -### -target x86_64-linux-gnu \ |
| 9 | +// RUN: -o a.bc -x hip --cuda-gpu-arch=gfx900 \ |
| 10 | +// RUN: --hip-device-lib=lib1.bc \ |
| 11 | +// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \ |
| 12 | +// RUN: %S/Inputs/hip_multiple_inputs/a.cu \ |
| 13 | +// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,BC %s |
| 14 | + |
| 15 | +// RUN: %clang -c -S -emit-llvm --cuda-device-only -### -target x86_64-linux-gnu \ |
| 16 | +// RUN: -o a.ll -x hip --cuda-gpu-arch=gfx900 \ |
| 17 | +// RUN: --hip-device-lib=lib1.bc \ |
| 18 | +// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \ |
| 19 | +// RUN: %S/Inputs/hip_multiple_inputs/a.cu \ |
| 20 | +// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,LL %s |
| 21 | + |
| 22 | +// RUN: %clang -c -S --cuda-device-only -### -target x86_64-linux-gnu \ |
| 23 | +// RUN: -o a.s -x hip --cuda-gpu-arch=gfx900 \ |
| 24 | +// RUN: --hip-device-lib=lib1.bc \ |
| 25 | +// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \ |
| 26 | +// RUN: %S/Inputs/hip_multiple_inputs/a.cu \ |
| 27 | +// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,ASM %s |
| 28 | + |
| 29 | +// CHECK: {{".*clang.*"}} "-cc1" "-triple" "amdgcn-amd-amdhsa" |
| 30 | +// CHECK-SAME: "-aux-triple" "x86_64-unknown-linux-gnu" |
| 31 | +// BC-SAME: "-emit-llvm-bc" |
| 32 | +// LL-SAME: "-emit-llvm" |
| 33 | +// ASM-NOT: "-emit-llvm" |
| 34 | +// CHECK-SAME: "-main-file-name" "a.cu" {{.*}} "-target-cpu" "gfx900" |
| 35 | +// CHECK-SAME: "-fcuda-is-device" |
| 36 | +// CHECK-SAME: {{".*lib1.bc"}} |
| 37 | +// BC-SAME: "-o" "a.bc" |
| 38 | +// LL-SAME: "-o" "a.ll" |
| 39 | +// ASM-SAME: "-o" "a.s" |
| 40 | +// CHECK-SAME: {{".*a.cu"}} |
| 41 | + |
| 42 | +// CHECK-NOT: {{"*.llvm-link"}} |
| 43 | +// CHECK-NOT: {{".*opt"}} |
| 44 | +// CHECK-NOT: {{".*llc"}} |
| 45 | +// CHECK-NOT: {{".*lld"}} |
| 46 | +// CHECK-NOT: {{".*clang-offload-bundler"}} |
| 47 | +// CHECK-NOT: {{".*ld.*"}} |
| 48 | + |
| 49 | +// If neither -emit-llvm nor -S is used in device only compilation, |
| 50 | +// the output should be bundled. |
| 51 | + |
| 52 | +// RUN: %clang -c --cuda-device-only -### -target x86_64-linux-gnu \ |
| 53 | +// RUN: -o a.s -x hip --cuda-gpu-arch=gfx900 \ |
| 54 | +// RUN: --hip-device-lib=lib1.bc \ |
| 55 | +// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \ |
| 56 | +// RUN: %S/Inputs/hip_multiple_inputs/a.cu \ |
| 57 | +// RUN: 2>&1 | FileCheck -check-prefixes=BUNDLE %s |
| 58 | + |
| 59 | +// RUN: %clang --cuda-device-only -### -target x86_64-linux-gnu \ |
| 60 | +// RUN: -o a.s -x hip --cuda-gpu-arch=gfx900 \ |
| 61 | +// RUN: --hip-device-lib=lib1.bc \ |
| 62 | +// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \ |
| 63 | +// RUN: %S/Inputs/hip_multiple_inputs/a.cu \ |
| 64 | +// RUN: 2>&1 | FileCheck -check-prefixes=BUNDLE %s |
| 65 | + |
| 66 | +// BUNDLE: {{"*.clang.*"}} |
| 67 | +// BUNDLE: {{"*.llvm-link"}} |
| 68 | +// BUNDLE: {{".*opt"}} |
| 69 | +// BUNDLE: {{".*llc"}} |
| 70 | +// BUNDLE: {{".*lld"}} |
| 71 | +// BUNDLE: {{".*clang-offload-bundler"}} |
| 72 | + |
0 commit comments