Skip to content

Commit f5a93c5

Browse files
authored
[clang] [test] Skip a test that sets PATH on Windows (#95096)
The same has been done in a couple other existing tests, that also are skipped on Windows (e.g. ld-path.c). Some tests that really do want to test setting the path on Windows does it differently, see e.g. ps4-ps5-linker-win.c. Since a65771f, the spirv-toolchain.cl test does one test where PATH is set. Setting PATH does work in some build configurations - however, if built with e.g. llvm-mingw, the built Clang executable depends on libc++.dll (and libunwind.dll) which are found in PATH. If the PATH is overridden, the newly built Clang executable no longer can run.
1 parent 9c29217 commit f5a93c5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

clang/test/Driver/spirv-toolchain.cl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,15 @@
8080

8181
//-----------------------------------------------------------------------------
8282
// Check llvm-spirv-<LLVM_VERSION_MAJOR> is used if it is found in PATH.
83+
//
84+
// This test uses the PATH environment variable; on Windows, we may need to retain
85+
// the original path for the built Clang binary to be able to execute (as it is
86+
// used for locating dependent DLLs). Therefore, skip this test on system-windows.
87+
//
8388
// RUN: mkdir -p %t/versioned
8489
// RUN: touch %t/versioned/llvm-spirv-%llvm-version-major \
8590
// RUN: && chmod +x %t/versioned/llvm-spirv-%llvm-version-major
86-
// RUN: env "PATH=%t/versioned" %clang -### --target=spirv64 -x cl -c %s 2>&1 \
87-
// RUN: | FileCheck -DVERSION=%llvm-version-major --check-prefix=VERSIONED %s
91+
// RUN: %if !system-windows %{ env "PATH=%t/versioned" %clang -### --target=spirv64 -x cl -c %s 2>&1 \
92+
// RUN: | FileCheck -DVERSION=%llvm-version-major --check-prefix=VERSIONED %s %}
8893

8994
// VERSIONED: {{.*}}llvm-spirv-[[VERSION]]

0 commit comments

Comments
 (0)