Skip to content

Commit 13b2094

Browse files
boomanaiden154GeneraluseAI
authored andcommitted
[clang][Driver] Use -no-canonical-prefixes in hip-spirv-backend-opt test (llvm#169717)
Otherwise the test can fail in weirder setups (like ours downstream where the actual binary path only contains the hash of the object). This makes the test more resilient, more consistent with other driver tests, and allows us to assert that the binary is named clang rather than clang-<some suffix>.
1 parent 607872a commit 13b2094

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

clang/test/Driver/hip-spirv-backend-opt.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,58 @@
44

55
// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
66
// RUN: -nogpuinc -nogpulib -### -x hip %s -save-temps \
7-
// RUN: -use-spirv-backend --offload-device-only -S \
7+
// RUN: -use-spirv-backend --offload-device-only -S -no-canonical-prefixes \
88
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-TEXTUAL
99

1010
// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
1111
// RUN: -nogpuinc -nogpulib -### -x hip %s -save-temps \
12-
// RUN: -use-spirv-backend --offload-device-only \
12+
// RUN: -use-spirv-backend --offload-device-only -no-canonical-prefixes \
1313
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-BINARY
1414

1515
// The new driver's behavior is to emit LLVM IR for --offload-device-only and -fgpu-rdc (independently of SPIR-V).
1616
// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
1717
// RUN: -### -nogpuinc -nogpulib -x hip %s -save-temps \
18-
// RUN: -use-spirv-backend --offload-device-only -S -fgpu-rdc \
18+
// RUN: -use-spirv-backend --offload-device-only -S -fgpu-rdc -no-canonical-prefixes \
1919
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-LL,CHECK-FGPU-RDC
2020

2121
// The new driver's behavior is to emit LLVM IR for --offload-device-only and -fgpu-rdc (independently of SPIR-V).
2222
// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
2323
// RUN: -nogpuinc -nogpulib -### -x hip %s -save-temps \
24-
// RUN: -use-spirv-backend --offload-device-only -fgpu-rdc \
24+
// RUN: -use-spirv-backend --offload-device-only -fgpu-rdc -no-canonical-prefixes \
2525
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-BC,CHECK-FGPU-RDC
2626

2727
// --offload-device-only is always unset --- testing interactions with -S and -fgpu-rdc
2828

2929
// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
3030
// RUN: -nogpuinc -nogpulib -### -x hip %s -save-temps \
31-
// RUN: -use-spirv-backend -S -fgpu-rdc \
31+
// RUN: -use-spirv-backend -S -fgpu-rdc -no-canonical-prefixes \
3232
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-BC,CHECK-FGPU-RDC
3333

3434
// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
3535
// RUN: -nogpuinc -nogpulib -### -x hip %s -save-temps \
36-
// RUN: -use-spirv-backend -S \
36+
// RUN: -use-spirv-backend -S -no-canonical-prefixes \
3737
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-BC
3838

3939
// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
4040
// RUN: -nogpuinc -nogpulib -### -x hip %s -save-temps \
41-
// RUN: -use-spirv-backend -fgpu-rdc \
41+
// RUN: -use-spirv-backend -fgpu-rdc -no-canonical-prefixes \
4242
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-BC,CHECK-CLANG-LINKER-WRAPPER
4343

4444
// RUN: %clang --offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
4545
// RUN: -nogpuinc -nogpulib -### -x hip %s -save-temps \
46-
// RUN: -use-spirv-backend \
46+
// RUN: -use-spirv-backend -no-canonical-prefixes \
4747
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-BC,CHECK-CLANG-LINKER-WRAPPER
4848

4949
// RUN: %clang --no-offload-new-driver --target=x86_64-unknown-linux-gnu --offload-arch=amdgcnspirv \
5050
// RUN: -nogpuinc -nogpulib -### -x hip %s -save-temps \
51-
// RUN: -use-spirv-backend \
51+
// RUN: -use-spirv-backend -no-canonical-prefixes \
5252
// RUN: 2>&1 | FileCheck %s --check-prefixes=CHECK-SPIRV-TRANSLATOR,CHECK-SPIRV-BACKEND-BC,CHECK-SPIRV-BACKEND-BINARY-EQ-TRIPLE
5353

5454
// CHECK-SPIRV-TRANSLATOR-NOT: "{{.*llvm-spirv.*}}"
55-
// CHECK-SPIRV-BACKEND-TEXTUAL: "{{.*}}clang{{.*}}" "-cc1" "-triple" "spirv64-amd-amdhsa" {{.*}} "-S"
56-
// CHECK-SPIRV-BACKEND-BINARY: "{{.*}}clang{{.*}}" "-cc1" "-triple" "spirv64-amd-amdhsa" {{.*}} "-emit-obj"
57-
// CHECK-SPIRV-BACKEND-BC: "{{.*}}clang{{.*}}" "-cc1" "-triple" "spirv64-amd-amdhsa" {{.*}} "-emit-llvm-bc"
58-
// CHECK-SPIRV-BACKEND-LL: "{{.*}}clang{{.*}}" "-cc1" "-triple" "spirv64-amd-amdhsa" {{.*}} "-emit-llvm"
59-
// CHECK-SPIRV-BACKEND-BINARY-EQ-TRIPLE: "{{.*}}clang{{.*}}" "-cc1" {{.*}}"-triple=spirv64-amd-amdhsa" {{.*}}"-emit-obj"
55+
// CHECK-SPIRV-BACKEND-TEXTUAL: "{{.*clang(\.exe)?}}" "-cc1" "-triple" "spirv64-amd-amdhsa" {{.*}} "-S"
56+
// CHECK-SPIRV-BACKEND-BINARY: "{{.*clang(\.exe)?}}" "-cc1" "-triple" "spirv64-amd-amdhsa" {{.*}} "-emit-obj"
57+
// CHECK-SPIRV-BACKEND-BC: "{{.*clang(\.exe)?}}" "-cc1" "-triple" "spirv64-amd-amdhsa" {{.*}} "-emit-llvm-bc"
58+
// CHECK-SPIRV-BACKEND-LL: "{{.*clang(\.exe)?}}" "-cc1" "-triple" "spirv64-amd-amdhsa" {{.*}} "-emit-llvm"
59+
// CHECK-SPIRV-BACKEND-BINARY-EQ-TRIPLE: "{{.*clang(\.exe)?}}" "-cc1" {{.*}}"-triple=spirv64-amd-amdhsa" {{.*}}"-emit-obj"
6060
// CHECK-FGPU-RDC-SAME: {{.*}} "-fgpu-rdc"
6161
// CHECK-CLANG-LINKER-WRAPPER: "{{.*}}clang-linker-wrapper" "--should-extract=amdgcnspirv" {{.*}} "--device-compiler=spirv64-amd-amdhsa=-use-spirv-backend"

0 commit comments

Comments
 (0)