[clang] [clang-sycl-linker] Migrate tests from Driver/ to Tooling/ and use LLVM IR input (PR #197566)
Alexey Bader via cfe-commits
cfe-commits at lists.llvm.org
Wed May 13 17:10:43 PDT 2026
================
@@ -0,0 +1,97 @@
+; Tests the clang-sycl-linker tool.
+;
+; REQUIRES: spirv-registered-target
+;
+; RUN: rm -rf %t && split-file %s %t
+; RUN: llvm-as %t/input1.ll -o %t/input1.bc
+; RUN: llvm-as %t/input2.ll -o %t/input2.bc
+;
+; Test the dry run of a simple case to link two input files.
+; RUN: clang-sycl-linker --dry-run -v -triple=spirv64 %t/input1.bc %t/input2.bc -o %t/spirv.out 2>&1 \
+; RUN: | FileCheck %s --check-prefix=SIMPLE-FO
+; SIMPLE-FO: sycl-device-link: inputs: {{.*}}.bc, {{.*}}.bc libfiles: output: [[LLVMLINKOUT:.*]].bc
+; SIMPLE-FO-NEXT: sycl-module-split: input: [[LLVMLINKOUT]].bc, output: [[LLVMLINKOUT]].bc, mode: none
+; SIMPLE-FO-NEXT: LLVM backend: input: [[LLVMLINKOUT]].bc, output: {{.*}}_0.spv
+;
+; Test that IMG_SPIRV image kind is set for non-AOT compilation.
+; RUN: llvm-objdump --offloading %t/spirv.out | FileCheck %s --check-prefix=IMAGE-KIND-SPIRV
+; IMAGE-KIND-SPIRV: kind spir-v
+;
+; Test the dry run of a simple case with device library files specified.
+; RUN: mkdir -p %t/libs
+; RUN: touch %t/libs/lib1.bc
+; RUN: touch %t/libs/lib2.bc
+; RUN: clang-sycl-linker --dry-run -v -triple=spirv64 %t/input1.bc %t/input2.bc --library-path=%t/libs --device-libs=lib1.bc,lib2.bc -o a.spv 2>&1 \
----------------
bader wrote:
Okay.
https://github.com/llvm/llvm-project/pull/197566
More information about the cfe-commits
mailing list