Skip to content

Commit a758efe

Browse files
committed
[clang-linker-wrapper][lit] Fix SPIR-V ELF test when spirv-tools feature is available
Signed-off-by: Sarnie, Nick <[email protected]>
1 parent 94f9d5d commit a758efe

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

clang/test/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ if(CLANG_BUILD_EXAMPLES AND CLANG_PLUGIN_SUPPORT)
103103
)
104104
endif ()
105105

106+
if(LLVM_INCLUDE_SPIRV_TOOLS_TESTS)
107+
list(APPEND CLANG_TEST_DEPS
108+
spirv-dis
109+
spirv-val
110+
spirv-as
111+
spirv-link
112+
)
113+
endif()
114+
106115
set(CLANG_TEST_PARAMS
107116
USE_Z3_SOLVER=0
108117
)

clang/test/Tooling/clang-linker-wrapper-spirv-elf.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Verify the ELF packaging of OpenMP SPIR-V device images.
22
// REQUIRES: system-linux
33
// REQUIRES: spirv-tools
4+
// REQUIRES: llvm-spirv
45
// RUN: mkdir -p %t_tmp
56
// RUN: cd %t_tmp
67
// RUN: %clangxx -fopenmp -fopenmp-targets=spirv64-intel -nogpulib -c -o %t_clang-linker-wrapper-spirv-elf.o %s

clang/test/Tooling/lit.local.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import shutil
2+
13
if not config.root.clang_staticanalyzer:
24
config.unsupported = True
35

@@ -6,3 +8,7 @@ if config.spirv_tools_tests:
68
config.substitutions.append(("spirv-dis", os.path.join(config.llvm_tools_dir, "spirv-dis")))
79
config.substitutions.append(("spirv-val", os.path.join(config.llvm_tools_dir, "spirv-val")))
810
config.substitutions.append(("spirv-as", os.path.join(config.llvm_tools_dir, "spirv-as")))
11+
config.substitutions.append(("spirv-link", os.path.join(config.llvm_tools_dir, "spirv-link")))
12+
13+
if shutil.which("llvm-spirv"):
14+
config.available_features.add("llvm-spirv")

0 commit comments

Comments
 (0)