|
1 | 1 | // Tests the clang-sycl-linker tool.
|
2 | 2 | //
|
3 |
| -// Test a simple case without arguments. |
4 |
| -// RUN: %clangxx -emit-llvm -c %s -o %t_1.bc |
5 |
| -// RUN: %clangxx -emit-llvm -c %s -o %t_2.bc |
6 |
| -// RUN: clang-sycl-linker --dry-run -triple spirv64 %t_1.bc %t_2.bc -o a.spv 2>&1 \ |
7 |
| -// RUN: | FileCheck %s --check-prefix=SIMPLE |
8 |
| -// SIMPLE: "{{.*}}llvm-link{{.*}}" {{.*}}.bc {{.*}}.bc -o [[FIRSTLLVMLINKOUT:.*]].bc --suppress-warnings |
9 |
| -// SIMPLE-NEXT: "{{.*}}llvm-spirv{{.*}}" {{.*}}-o a.spv [[FIRSTLLVMLINKOUT]].bc |
| 3 | +// Test the dry run of a simple case to link two input files. |
| 4 | +// RUN: %clangxx -emit-llvm -c -target spirv64 %s -o %t_1.bc |
| 5 | +// RUN: %clangxx -emit-llvm -c -target spirv64 %s -o %t_2.bc |
| 6 | +// RUN: clang-sycl-linker --dry-run -v -triple=spirv64 %t_1.bc %t_2.bc -o a.spv 2>&1 \ |
| 7 | +// RUN: | FileCheck %s --check-prefix=SIMPLE-FO |
| 8 | +// SIMPLE-FO: sycl-device-link: inputs: {{.*}}.bc, {{.*}}.bc libfiles: output: [[LLVMLINKOUT:.*]].bc |
| 9 | +// SIMPLE-FO-NEXT: "{{.*}}llvm-spirv{{.*}}" {{.*}}-o a.spv [[LLVMLINKOUT]].bc |
10 | 10 | //
|
11 |
| -// Test that llvm-link is not called when only one input is present. |
12 |
| -// RUN: clang-sycl-linker --dry-run -triple spirv64 %t_1.bc -o a.spv 2>&1 \ |
13 |
| -// RUN: | FileCheck %s --check-prefix=SIMPLE-NO-LINK |
14 |
| -// SIMPLE-NO-LINK: "{{.*}}llvm-spirv{{.*}}" {{.*}}-o a.spv {{.*}}.bc |
15 |
| -// |
16 |
| -// Test a simple case with device library files specified. |
| 11 | +// Test the dry run of a simple case with device library files specified. |
17 | 12 | // RUN: touch %T/lib1.bc
|
18 | 13 | // RUN: touch %T/lib2.bc
|
19 |
| -// RUN: clang-sycl-linker --dry-run -triple spirv64 %t_1.bc %t_2.bc --library-path=%T --device-libs=lib1.bc,lib2.bc -o a.spv 2>&1 \ |
| 14 | +// RUN: clang-sycl-linker --dry-run -v -triple=spirv64 %t_1.bc %t_2.bc --library-path=%T --device-libs=lib1.bc,lib2.bc -o a.spv 2>&1 \ |
20 | 15 | // RUN: | FileCheck %s --check-prefix=DEVLIBS
|
21 |
| -// DEVLIBS: "{{.*}}llvm-link{{.*}}" {{.*}}.bc {{.*}}.bc -o [[FIRSTLLVMLINKOUT:.*]].bc --suppress-warnings |
22 |
| -// DEVLIBS-NEXT: "{{.*}}llvm-link{{.*}}" -only-needed [[FIRSTLLVMLINKOUT]].bc {{.*}}lib1.bc {{.*}}lib2.bc -o [[SECONDLLVMLINKOUT:.*]].bc --suppress-warnings |
23 |
| -// DEVLIBS-NEXT: "{{.*}}llvm-spirv{{.*}}" {{.*}}-o a.spv [[SECONDLLVMLINKOUT]].bc |
| 16 | +// DEVLIBS: sycl-device-link: inputs: {{.*}}.bc libfiles: {{.*}}lib1.bc, {{.*}}lib2.bc output: [[LLVMLINKOUT:.*]].bc |
| 17 | +// DEVLIBS-NEXT: "{{.*}}llvm-spirv{{.*}}" {{.*}}-o a.spv [[LLVMLINKOUT]].bc |
24 | 18 | //
|
25 |
| -// Test a simple case with .o (fat object) as input. |
26 |
| -// TODO: Remove this test once fat object support is added. |
27 |
| -// RUN: %clangxx -c %s -o %t.o |
28 |
| -// RUN: not clang-sycl-linker --dry-run -triple spirv64 %t.o -o a.spv 2>&1 \ |
| 19 | +// Test a simple case with a random file (not bitcode) as input. |
| 20 | +// RUN: touch %t.o |
| 21 | +// RUN: not clang-sycl-linker -triple spirv64 %t.o -o a.spv 2>&1 \ |
29 | 22 | // RUN: | FileCheck %s --check-prefix=FILETYPEERROR
|
30 | 23 | // FILETYPEERROR: Unsupported file type
|
31 | 24 | //
|
32 | 25 | // Test to see if device library related errors are emitted.
|
33 |
| -// RUN: not clang-sycl-linker --dry-run -triple spirv64 %t_1.bc %t_2.bc --library-path=%T --device-libs= -o a.spv 2>&1 \ |
| 26 | +// RUN: not clang-sycl-linker --dry-run -triple=spirv64 %t_1.bc %t_2.bc --library-path=%T --device-libs= -o a.spv 2>&1 \ |
34 | 27 | // RUN: | FileCheck %s --check-prefix=DEVLIBSERR1
|
35 | 28 | // DEVLIBSERR1: Number of device library files cannot be zero
|
36 |
| -// RUN: not clang-sycl-linker --dry-run -triple spirv64 %t_1.bc %t_2.bc --library-path=%T --device-libs=lib1.bc,lib2.bc,lib3.bc -o a.spv 2>&1 \ |
| 29 | +// RUN: not clang-sycl-linker --dry-run -triple=spirv64 %t_1.bc %t_2.bc --library-path=%T --device-libs=lib1.bc,lib2.bc,lib3.bc -o a.spv 2>&1 \ |
37 | 30 | // RUN: | FileCheck %s --check-prefix=DEVLIBSERR2
|
38 | 31 | // DEVLIBSERR2: '{{.*}}lib3.bc' SYCL device library file is not found
|
39 | 32 | //
|
40 | 33 | // Test if correct set of llvm-spirv options are emitted for windows environment.
|
41 |
| -// RUN: clang-sycl-linker --dry-run -triple spirv64 --is-windows-msvc-env %t_1.bc %t_2.bc -o a.spv 2>&1 \ |
| 34 | +// RUN: clang-sycl-linker --dry-run -v -triple=spirv64 --is-windows-msvc-env %t_1.bc %t_2.bc -o a.spv 2>&1 \ |
42 | 35 | // RUN: | FileCheck %s --check-prefix=LLVMOPTSWIN
|
43 | 36 | // LLVMOPTSWIN: -spirv-debug-info-version=ocl-100 -spirv-allow-extra-diexpressions -spirv-allow-unknown-intrinsics=llvm.genx. -spirv-ext=
|
44 | 37 | //
|
45 | 38 | // Test if correct set of llvm-spirv options are emitted for linux environment.
|
46 |
| -// RUN: clang-sycl-linker --dry-run -triple spirv64 %t_1.bc %t_2.bc -o a.spv 2>&1 \ |
| 39 | +// RUN: clang-sycl-linker --dry-run -v -triple=spirv64 %t_1.bc %t_2.bc -o a.spv 2>&1 \ |
47 | 40 | // RUN: | FileCheck %s --check-prefix=LLVMOPTSLIN
|
48 | 41 | // LLVMOPTSLIN: -spirv-debug-info-version=nonsemantic-shader-200 -spirv-allow-unknown-intrinsics=llvm.genx. -spirv-ext=
|
0 commit comments