Skip to content

Commit 4688719

Browse files
authored
[clang-sycl-linker] Fix flaky failure and add REQUIRES (#134125)
This should fix failures caused by #133967 Attn: @sarnex Thanks Signed-off-by: Arvind Sudarsanam <[email protected]>
1 parent a3ac318 commit 4688719

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ static Expected<StringRef> runSPIRVCodeGen(StringRef File, const ArgList &Args,
282282
LLVMContext &C) {
283283
llvm::TimeTraceScope TimeScope("SPIR-V code generation");
284284

285+
if (Error Err = M->materializeAll())
286+
return std::move(Err);
287+
285288
// Parse input module.
286289
SMDiagnostic Err;
287290
std::unique_ptr<Module> M = parseIRFile(File, Err, C);

0 commit comments

Comments
 (0)