[clang-sycl-linker] Fix flaky failure and add REQUIRES (Try #2) (#134130)

This should fix failures caused by
https://github.com/llvm/llvm-project/pull/133967
Attn: @sarnex
Thanks

Signed-off-by: Arvind Sudarsanam <arvind.sudarsanam@intel.com>
This commit is contained in:
Arvind Sudarsanam
2025-04-02 14:05:17 -04:00
committed by GitHub
parent beae0e9f1a
commit 32dff27060
4 changed files with 9 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
// Tests the clang-sycl-linker tool.
//
// REQUIRES: spirv-registered-target
//
// Test the dry run of a simple case to link two input files.
// RUN: %clangxx -emit-llvm -c -target spirv64 %s -o %t_1.bc
// RUN: %clangxx -emit-llvm -c -target spirv64 %s -o %t_2.bc

View File

@@ -1,3 +1,5 @@
# REQUIRES: spirv-registered-target
# RUN: llvm-as %S/Inputs/SYCL/foo.ll -o %t.foo.bc
# RUN: llvm-as %S/Inputs/SYCL/bar.ll -o %t.bar.bc
# RUN: llvm-as %S/Inputs/SYCL/baz.ll -o %t.baz.bc

View File

@@ -1,6 +1,8 @@
// Tests the driver when linking LLVM IR bitcode files and targeting SPIR-V
// architecture.
//
// REQUIRES: spirv-registered-target
//
// Test that -Xlinker options are being passed to clang-sycl-linker.
// RUN: touch %t.bc
// RUN: %clangxx -### --target=spirv64 --sycl-link -Xlinker -triple=spirv64 -Xlinker --library-path=/tmp \

View File

@@ -288,6 +288,9 @@ static Expected<StringRef> runSPIRVCodeGen(StringRef File, const ArgList &Args,
if (!M)
return createStringError(Err.getMessage());
if (Error Err = M->materializeAll())
return std::move(Err);
Triple TargetTriple(Args.getLastArgValue(OPT_triple_EQ));
M->setTargetTriple(TargetTriple);