|
| 1 | +// Test the search logic for the libspirv bitcode library in the offloading toolchains that need it. |
| 2 | + |
| 3 | +// DEFINE: %{install_dir} = %/S/Inputs/SYCL/bin |
| 4 | +// DEFINE: %{resource_dir} = %/S/Inputs/SYCL/lib/clang/resource_dir |
| 5 | + |
1 | 6 | // RUN: %clang -### -fsycl -fsycl-targets=nvptx64-nvidia-cuda -nocudalib -target x86_64-unknown-windows-msvc %s 2>&1 \
|
2 | 7 | // RUN: | FileCheck %s --check-prefixes=CHECK-WINDOWS
|
3 | 8 | // CHECK-WINDOWS: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-mlink-builtin-bitcode" "{{.*[\\/]}}remangled-l32-signed_char.libspirv-nvptx64-nvidia-cuda.bc"
|
|
7 | 12 | // CHECK-LINUX: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-mlink-builtin-bitcode" "{{.*[\\/]}}remangled-l64-signed_char.libspirv-nvptx64-nvidia-cuda.bc"
|
8 | 13 | //
|
9 | 14 | // AMDGCN wrongly uses 32-bit longs on Windows
|
10 |
| -// RUN: %clang -### -resource-dir %S/Inputs/SYCL/lib/clang/resource_dir -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx908 -nogpulib -target x86_64-unknown-windows-msvc %s 2>&1 \ |
| 15 | +// RUN: %clang -### -resource-dir %{resource_dir} -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx908 -nogpulib -target x86_64-unknown-windows-msvc %s 2>&1 \ |
11 | 16 | // RUN: | FileCheck %s --check-prefixes=CHECK-AMDGCN-WINDOWS
|
12 | 17 | // CHECK-AMDGCN-WINDOWS: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-mlink-builtin-bitcode" "{{.*[\\/]}}remangled-l64-signed_char.libspirv-amdgcn-amd-amdhsa.bc"
|
13 | 18 | //
|
|
23 | 28 | // CHECK-CUDA-NOT: "-mlink-builtin-bitcode" "{{.*}}.libspirv-{{.*}}.bc"
|
24 | 29 | //
|
25 | 30 | // The path to the remangled libspirv bitcode file is determined by the resource directory.
|
26 |
| -// RUN: %clang -### -ccc-install-dir %S/Inputs/SYCL/bin -resource-dir %S/Inputs/SYCL/lib/clang/resource_dir -fsycl -fsycl-targets=nvptx64-nvidia-cuda -nocudalib %s 2>&1 \ |
27 |
| -// RUN: | FileCheck %s -DINSTALL_DIR=%S/Inputs/SYCL/bin -DRESOURCE_DIR=%S/Inputs/SYCL/lib/clang/resource_dir --check-prefixes=CHECK-DIR |
| 31 | +// RUN: %clang -### -ccc-install-dir %{install_dir} -resource-dir %{resource_dir} -fsycl -fsycl-targets=nvptx64-nvidia-cuda -nocudalib %s 2>&1 \ |
| 32 | +// RUN: | FileCheck %s -DINSTALL_DIR=%{install_dir} -DRESOURCE_DIR=%{resource_dir} --check-prefixes=CHECK-DIR |
28 | 33 | // CHECK-DIR: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-mlink-builtin-bitcode" "[[RESOURCE_DIR]]{{.*[\\/]}}remangled-{{.*}}.libspirv-nvptx64-nvidia-cuda.bc"
|
29 | 34 | //
|
30 | 35 | // The `-###` option disables file existence checks
|
31 |
| -// RUN: %clang -### -resource-dir %S/Inputs/SYCL/does_not_exist/lib/clang/resource_dir -fsycl -fsycl-targets=nvptx64-nvidia-cuda -nocudalib %s 2>&1 \ |
32 |
| -// RUN: | FileCheck %s -DDIR=%S/Inputs/SYCL/does_not_exist/lib/clang/resource_dir --check-prefixes=CHECK-HHH-NOT-FOUND |
33 |
| -// CHECK-HHH-NOT-FOUND: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-mlink-builtin-bitcode" "[[DIR]]{{.*[\\/]}}remangled-{{.*}}.libspirv-nvptx64-nvidia-cuda.bc" |
| 36 | +// DEFINE: %{nonexistent_dir} = %/S/Inputs/SYCL/does_not_exist/lib/clang/resource_dir |
| 37 | +// RUN: %clang -### -resource-dir %{nonexistent_dir} -fsycl -fsycl-targets=nvptx64-nvidia-cuda -nocudalib %s 2>&1 \ |
| 38 | +// RUN: | FileCheck %s -DDIR=%{nonexistent_dir} --check-prefixes=CHECK-HHH-NONEXISTENT |
| 39 | +// CHECK-HHH-NONEXISTENT: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-mlink-builtin-bitcode" "[[DIR]]{{.*[\\/]}}remangled-{{.*}}.libspirv-nvptx64-nvidia-cuda.bc" |
34 | 40 | //
|
35 | 41 | // But not for AMDGCN :^)
|
36 |
| -// RUN: not %clang -### -resource-dir %S/Inputs/SYCL/does_not_exist/lib/clang/resource_dir -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx908 -nogpulib %s 2>&1 \ |
37 |
| -// RUN: | FileCheck %s -DDIR=%S/Inputs/SYCL/does_not_exist/lib/clang/resource_dir --check-prefixes=CHECK-AMDGCN-HHH-NOT-FOUND |
38 |
| -// CHECK-AMDGCN-HHH-NOT-FOUND: error: cannot find 'remangled-{{.*}}.libspirv-amdgcn-amd-amdhsa.bc'; provide path to libspirv library via '-fsycl-libspirv-path', or pass '-fno-sycl-libspirv' to build without linking with libspirv |
| 42 | +// RUN: not %clang -### -resource-dir %{nonexistent_dir} -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx908 -nogpulib %s 2>&1 \ |
| 43 | +// RUN: | FileCheck %s -DDIR=%{nonexistent_dir} --check-prefixes=CHECK-AMDGCN-HHH-NONEXISTENT |
| 44 | +// CHECK-AMDGCN-HHH-NONEXISTENT: error: cannot find 'remangled-{{.*}}.libspirv-amdgcn-amd-amdhsa.bc'; provide path to libspirv library via '-fsycl-libspirv-path', or pass '-fno-sycl-libspirv' to build without linking with libspirv |
39 | 45 | //
|
40 | 46 | // `-fdriver-only` has no such special handling, so it will not find the file
|
41 |
| -// RUN: not %clang -fdriver-only -resource-dir %S/Inputs/SYCL/does_not_exist/lib/clang/resource_dir -fsycl -fsycl-targets=nvptx64-nvidia-cuda -nocudalib %s 2>&1 \ |
42 |
| -// RUN: | FileCheck %s -DDIR=%S/Inputs/SYCL/does_not_exist/lib/clang/resource_dir --check-prefixes=CHECK-DO-NOT-FOUND |
43 |
| -// CHECK-DO-NOT-FOUND: error: cannot find 'remangled-{{.*}}.libspirv-nvptx64-nvidia-cuda.bc'; provide path to libspirv library via '-fsycl-libspirv-path', or pass '-fno-sycl-libspirv' to build without linking with libspirv |
| 47 | +// RUN: not %clang -fdriver-only -resource-dir %{nonexistent_dir} -fsycl -fsycl-targets=nvptx64-nvidia-cuda -nocudalib %s 2>&1 \ |
| 48 | +// RUN: | FileCheck %s --check-prefixes=CHECK-DO-NONEXISTENT |
| 49 | +// CHECK-DO-NONEXISTENT: error: cannot find 'remangled-{{.*}}.libspirv-nvptx64-nvidia-cuda.bc'; provide path to libspirv library via '-fsycl-libspirv-path', or pass '-fno-sycl-libspirv' to build without linking with libspirv |
0 commit comments