Debian Codegraph @

clang/test/Driver/link-device-code.test

raw
1 # REQUIRES: spirv-registered-target
2
3 # RUN: llvm-as %S/Inputs/SYCL/foo.ll -o %t.foo.bc
4 # RUN: llvm-as %S/Inputs/SYCL/bar.ll -o %t.bar.bc
5 # RUN: llvm-as %S/Inputs/SYCL/baz.ll -o %t.baz.bc
6 # RUN: llvm-as %S/Inputs/SYCL/libsycl.ll -o %t.libsycl.bc
7 # 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
8
9 # 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
10
11 # 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
12
13 ; CHECK-SIMPLE: define {{.*}}foo_func1{{.*}}
14 ; CHECK-SIMPLE: define {{.*}}foo_func2{{.*}}
15 ; CHECK-SIMPLE: define {{.*}}bar_func1{{.*}}
16 ; CHECK-SIMPLE-NOT: define {{.*}}addFive{{.*}}
17 ; CHECK-SIMPLE-NOT: define {{.*}}unusedFunc{{.*}}
18
19 ; CHECK-MULTIPLE-DEFS: error: Linking globals named {{.*}}bar_func1{{.*}} symbol multiply defined!
20
21 ; CHECK-DEVICE-LIB: define {{.*}}foo_func1{{.*}}
22 ; CHECK-DEVICE-LIB: define {{.*}}foo_func2{{.*}}
23 ; CHECK-DEVICE-LIB: define {{.*}}bar_func1{{.*}}
24 ; CHECK-DEVICE-LIB: define {{.*}}addFive{{.*}}
25 ; CHECK-DEVICE-LIB-NOT: define {{.*}}unusedFunc{{.*}}