Skip to content

Commit 8f4ea47

Browse files
committed
Improve test
- Hopefully fix windows failure - Add summary of the test
1 parent cfee27a commit 8f4ea47

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed
Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
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+
16
// RUN: %clang -### -fsycl -fsycl-targets=nvptx64-nvidia-cuda -nocudalib -target x86_64-unknown-windows-msvc %s 2>&1 \
27
// RUN: | FileCheck %s --check-prefixes=CHECK-WINDOWS
38
// CHECK-WINDOWS: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-mlink-builtin-bitcode" "{{.*[\\/]}}remangled-l32-signed_char.libspirv-nvptx64-nvidia-cuda.bc"
@@ -7,7 +12,7 @@
712
// CHECK-LINUX: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-mlink-builtin-bitcode" "{{.*[\\/]}}remangled-l64-signed_char.libspirv-nvptx64-nvidia-cuda.bc"
813
//
914
// 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 \
1116
// RUN: | FileCheck %s --check-prefixes=CHECK-AMDGCN-WINDOWS
1217
// CHECK-AMDGCN-WINDOWS: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-mlink-builtin-bitcode" "{{.*[\\/]}}remangled-l64-signed_char.libspirv-amdgcn-amd-amdhsa.bc"
1318
//
@@ -23,21 +28,22 @@
2328
// CHECK-CUDA-NOT: "-mlink-builtin-bitcode" "{{.*}}.libspirv-{{.*}}.bc"
2429
//
2530
// 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
2833
// CHECK-DIR: "-cc1"{{.*}} "-fsycl-is-device"{{.*}} "-mlink-builtin-bitcode" "[[RESOURCE_DIR]]{{.*[\\/]}}remangled-{{.*}}.libspirv-nvptx64-nvidia-cuda.bc"
2934
//
3035
// 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"
3440
//
3541
// 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
3945
//
4046
// `-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

Comments
 (0)