[clang] [llvm] [clang-sycl-linker] Add per-translation-unit device code split mode (PR #196435)

Alexey Bader via cfe-commits cfe-commits at lists.llvm.org
Sat May 9 12:39:31 PDT 2026


================
@@ -75,11 +70,12 @@
 // RUN: | FileCheck %s --check-prefix=NOTARGET
 // NOTARGET: Target triple must be specified
 //
-// Test the split mode ("none"): no extra splits are produced.
-// RUN: clang-sycl-linker --dry-run -v -triple=spirv64 --module-split-mode=none %t_1.bc %t_2.bc -o %t-split-none.out 2>&1 \
+// Test the split mode ("none"): kernels from different TUs are not split into
+// separate images.
----------------
bader wrote:

A few test improvement suggestions.

If the intention to separate all tests for "split mode", I suggest we create a separate file for it (e.g. `clang/test/Driver/clang-sycl-linker-split-mode.cpp`).

I would drop the "-test" suffix from the test name: "`clang/test/Driver/clang-sycl-linker-test.cpp`" -> "`clang/test/Driver/clang-sycl-linker.cpp`". It doesn't seem to be useful.

Finally, consider moving clang-sycl-linker tests from the Driver to Tooling directory. There tests can be written in LLVM, so you can convert Input *.ll files into tests (i.e. no need to create a separate *.cpp file for LIT commands).

https://github.com/llvm/llvm-project/pull/196435


More information about the cfe-commits mailing list