Skip to content

Commit 32dff27

Browse files
authored
[clang-sycl-linker] Fix flaky failure and add REQUIRES (Try #2) (#134130)
This should fix failures caused by llvm/llvm-project#133967 Attn: @sarnex Thanks Signed-off-by: Arvind Sudarsanam <arvind.sudarsanam@intel.com>
1 parent beae0e9 commit 32dff27

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

clang/test/Driver/clang-sycl-linker-test.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Tests the clang-sycl-linker tool.
22
//
3+
// REQUIRES: spirv-registered-target
4+
//
35
// Test the dry run of a simple case to link two input files.
46
// RUN: %clangxx -emit-llvm -c -target spirv64 %s -o %t_1.bc
57
// RUN: %clangxx -emit-llvm -c -target spirv64 %s -o %t_2.bc

clang/test/Driver/link-device-code.test

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# REQUIRES: spirv-registered-target
2+
13
# RUN: llvm-as %S/Inputs/SYCL/foo.ll -o %t.foo.bc
24
# RUN: llvm-as %S/Inputs/SYCL/bar.ll -o %t.bar.bc
35
# RUN: llvm-as %S/Inputs/SYCL/baz.ll -o %t.baz.bc

clang/test/Driver/sycl-link-spirv-target.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Tests the driver when linking LLVM IR bitcode files and targeting SPIR-V
22
// architecture.
33
//
4+
// REQUIRES: spirv-registered-target
5+
//
46
// Test that -Xlinker options are being passed to clang-sycl-linker.
57
// RUN: touch %t.bc
68
// RUN: %clangxx -### --target=spirv64 --sycl-link -Xlinker -triple=spirv64 -Xlinker --library-path=/tmp \

clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ static Expected<StringRef> runSPIRVCodeGen(StringRef File, const ArgList &Args,
288288
if (!M)
289289
return createStringError(Err.getMessage());
290290

291+
if (Error Err = M->materializeAll())
292+
return std::move(Err);
293+
291294
Triple TargetTriple(Args.getLastArgValue(OPT_triple_EQ));
292295
M->setTargetTriple(TargetTriple);
293296

0 commit comments

Comments
 (0)