# 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/libsycl.ll -o %t.libsycl.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.libsycl.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{{.*}}