Skip to content

Commit 8e5e09f

Browse files
committed
[clang] [test] Skip a test that sets PATH= on Windows
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. Split the test that requires setting PATH to a separate file, and mark it as unsupported on Windows.
1 parent 9dfd076 commit 8e5e09f

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/// This test uses the PATH environment variable; on Windows, we may need to retain
2+
/// the original path for the built Clang binary to be able to execute (as it is
3+
/// used for locating dependent DLLs).
4+
// UNSUPPORTED: system-windows
5+
6+
//-----------------------------------------------------------------------------
7+
// Check llvm-spirv-<LLVM_VERSION_MAJOR> is used if it is found in PATH.
8+
// RUN: mkdir -p %t/versioned
9+
// RUN: touch %t/versioned/llvm-spirv-%llvm-version-major \
10+
// RUN: && chmod +x %t/versioned/llvm-spirv-%llvm-version-major
11+
// RUN: env "PATH=%t/versioned" %clang -### --target=spirv64 -x cl -c %s 2>&1 \
12+
// RUN: | FileCheck -DVERSION=%llvm-version-major --check-prefix=VERSIONED %s
13+
14+
// VERSIONED: {{.*}}llvm-spirv-[[VERSION]]

clang/test/Driver/spirv-toolchain.cl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,3 @@
7777

7878
// XTOR: {{llvm-spirv.*"}}
7979
// BACKEND-NOT: {{llvm-spirv.*"}}
80-
81-
//-----------------------------------------------------------------------------
82-
// Check llvm-spirv-<LLVM_VERSION_MAJOR> is used if it is found in PATH.
83-
// RUN: mkdir -p %t/versioned
84-
// RUN: touch %t/versioned/llvm-spirv-%llvm-version-major \
85-
// 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
88-
89-
// VERSIONED: {{.*}}llvm-spirv-[[VERSION]]

0 commit comments

Comments
 (0)