[clang] [Clang][SYCL] Introduce clang-sycl-linker to link SYCL offloading device code (Part 1 of many) (PR #112245)
Arvind Sudarsanam via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 29 13:28:07 PDT 2024
================
@@ -0,0 +1,13 @@
+// Tests the driver when linking LLVM IR bitcode files and targeting SPIR-V
+// architecture.
+//
+// RUN: touch %t.bc
+// RUN: %clangxx --target=spirv64 --sycl-link -### %t.bc 2>&1 \
+// RUN: | FileCheck %s -check-prefix=LINK
+// LINK: "{{.*}}clang-sycl-linker{{.*}}" "{{.*}}.bc" "-o" "a.out"
+//
+// Test that -Xlinker options are being passed to clang-sycl-linker.
+// RUN: %clangxx -### --target=spirv64 --sycl-link -Xlinker --llvm-spirv-path=/tmp \
+// RUN: -Xlinker --library-path=/tmp -Xlinker --device-libs=lib1.bc,lib2.bc %t.bc 2>&1 \
+// RUN: | FileCheck %s -check-prefix=XLINKEROPTS
+// XLINKEROPTS: "{{.*}}clang-sycl-linker{{.*}}" "--llvm-spirv-path=/tmp" "--library-path=/tmp" "--device-libs=lib1.bc,lib2.bc" "{{.*}}.bc" "-o" "a.out"
----------------
asudarsa wrote:
First test is expected to test the set of commands invoked for 'clang-sycl-linker --dry-run'
and the second test is expected to test the correct invocation of slang-sycl-linker' for 'clang++ --sycl-link -target=spirv <and other options>'.
Both these tests are expected to evolve as we add more support.
Thanks
https://github.com/llvm/llvm-project/pull/112245
More information about the cfe-commits
mailing list