| 1 |
// RUN: %clang -### --target=x86_64-linux-gnu \ |
| 2 |
// RUN: -x hip --cuda-gpu-arch=gfx803 -flto-partitions=42 \ |
| 3 |
// RUN: --no-offload-new-driver --emit-static-lib -nogpulib \ |
| 4 |
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \ |
| 5 |
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \ |
| 6 |
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \ |
| 7 |
// RUN: 2>&1 | FileCheck %s --check-prefix=FIXED-PARTS |
| 8 |
|
| 9 |
// FIXED-PARTS-NOT: "*.llvm-link" |
| 10 |
// FIXED-PARTS-NOT: ".*opt" |
| 11 |
// FIXED-PARTS-NOT: ".*llc" |
| 12 |
// FIXED-PARTS: [[LLD: ".*lld.*"]] {{.*}} "-plugin-opt=-amdgpu-internalize-symbols" |
| 13 |
// FIXED-PARTS-SAME: "--lto-partitions=42" |
| 14 |
// FIXED-PARTS-SAME: "-plugin-opt=mcpu=gfx803" |
| 15 |
// FIXED-PARTS-SAME: "-o" "{{.*out}}" "{{.*bc}}" |
| 16 |
|
| 17 |
// RUN: not %clang -### --target=x86_64-linux-gnu \ |
| 18 |
// RUN: -x hip --cuda-gpu-arch=gfx803 -flto-partitions=a \ |
| 19 |
// RUN: --no-offload-new-driver --emit-static-lib -nogpulib \ |
| 20 |
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \ |
| 21 |
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \ |
| 22 |
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \ |
| 23 |
// RUN: 2>&1 | FileCheck %s --check-prefix=LTO_PARTS_INV0 |
| 24 |
|
| 25 |
// LTO_PARTS_INV0: clang: error: invalid integral value 'a' in '-flto-partitions=a' |
| 26 |
|
| 27 |
// RUN: not %clang -### --target=x86_64-linux-gnu \ |
| 28 |
// RUN: -x hip --cuda-gpu-arch=gfx803 -flto-partitions=0 \ |
| 29 |
// RUN: --no-offload-new-driver --emit-static-lib -nogpulib \ |
| 30 |
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \ |
| 31 |
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \ |
| 32 |
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \ |
| 33 |
// RUN: 2>&1 | FileCheck %s --check-prefix=LTO_PARTS_INV1 |
| 34 |
|
| 35 |
// LTO_PARTS_INV1: clang: error: invalid integral value '0' in '-flto-partitions=0' |