mirror-llvm-project/clang/test/Driver/link-device-code.test
Sergey Semenov 5cd21e8498
[libsycl][Driver] Move and rename the SYCL shared library (#188770)
Align the shared library with other runtime libraries:

- Rename from libsycl.so to libLLVMSYCL.so
- Make install dir include the host triple if
LLVM_ENABLE_PER_TARGET_RUNTIME_DIR is ON.

Also updates the Clang driver to be aligned with the new location by
relanding https://github.com/llvm/llvm-project/pull/189053

---------

Co-authored-by: Srividya Sundaram <srividya.sundaram@intel.com>
2026-04-20 11:54:02 -07:00

25 lines
1.3 KiB
Text

# 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
# RUN: llvm-as %S/Inputs/SYCL/libLLVMSYCL.ll -o %t.libLLVMSYCL.bc
# RUN: clang-sycl-linker %t.foo.bc %t.bar.bc -triple=spirv64 --dry-run -o a.spv --print-linked-module 2>&1 | FileCheck %s --check-prefix=CHECK-SIMPLE
# RUN: not clang-sycl-linker %t.bar.bc %t.baz.bc -triple=spirv64 --dry-run -o a.spv --print-linked-module 2>&1 | FileCheck %s --check-prefix=CHECK-MULTIPLE-DEFS
# RUN: clang-sycl-linker %t.foo.bc %t.bar.bc -device-libs=%t.libLLVMSYCL.bc -library-path= -triple=spirv64 --dry-run -o a.spv --print-linked-module 2>&1 | FileCheck %s --check-prefix=CHECK-DEVICE-LIB
; CHECK-SIMPLE: define {{.*}}foo_func1{{.*}}
; CHECK-SIMPLE: define {{.*}}foo_func2{{.*}}
; CHECK-SIMPLE: define {{.*}}bar_func1{{.*}}
; CHECK-SIMPLE-NOT: define {{.*}}addFive{{.*}}
; CHECK-SIMPLE-NOT: define {{.*}}unusedFunc{{.*}}
; CHECK-MULTIPLE-DEFS: error: Linking globals named {{.*}}bar_func1{{.*}} symbol multiply defined!
; CHECK-DEVICE-LIB: define {{.*}}foo_func1{{.*}}
; CHECK-DEVICE-LIB: define {{.*}}foo_func2{{.*}}
; CHECK-DEVICE-LIB: define {{.*}}bar_func1{{.*}}
; CHECK-DEVICE-LIB: define {{.*}}addFive{{.*}}
; CHECK-DEVICE-LIB-NOT: define {{.*}}unusedFunc{{.*}}