[clang] [clang] [test] Skip a test that sets PATH= on Windows (PR #95096)

2024-06-13 Thread Martin Storsjö via cfe-commits

https://github.com/mstorsjo closed 
https://github.com/llvm/llvm-project/pull/95096
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] [test] Skip a test that sets PATH= on Windows (PR #95096)

2024-06-13 Thread Martin Storsjö via cfe-commits

https://github.com/mstorsjo edited 
https://github.com/llvm/llvm-project/pull/95096
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] [test] Skip a test that sets PATH= on Windows (PR #95096)

2024-06-12 Thread Martin Storsjö via cfe-commits


@@ -77,13 +77,3 @@
 
 // XTOR: {{llvm-spirv.*"}}
 // BACKEND-NOT: {{llvm-spirv.*"}}
-
-//-
-// Check llvm-spirv- is used if it is found in PATH.
-// RUN: mkdir -p %t/versioned
-// RUN: touch %t/versioned/llvm-spirv-%llvm-version-major \
-// RUN:   && chmod +x %t/versioned/llvm-spirv-%llvm-version-major
-// RUN: env "PATH=%t/versioned" %clang -### --target=spirv64 -x cl -c %s 2>&1 \

mstorsjo wrote:

Ok, updated the PR to use `%if !system-windows` instead - tested that it does 
seem to work as expected here.

https://github.com/llvm/llvm-project/pull/95096
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] [test] Skip a test that sets PATH= on Windows (PR #95096)

2024-06-12 Thread Martin Storsjö via cfe-commits

https://github.com/mstorsjo updated 
https://github.com/llvm/llvm-project/pull/95096

From 11b577825a15bcd6139863adb047ef5f7b161a36 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= 
Date: Tue, 11 Jun 2024 13:14:47 +0300
Subject: [PATCH] [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 a65771fce4a2f25f16d4b3918ad6a11370637f7b, 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.
---
 clang/test/Driver/spirv-toolchain.cl | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/clang/test/Driver/spirv-toolchain.cl 
b/clang/test/Driver/spirv-toolchain.cl
index de818177cb19f..eff02f809ce83 100644
--- a/clang/test/Driver/spirv-toolchain.cl
+++ b/clang/test/Driver/spirv-toolchain.cl
@@ -80,10 +80,15 @@
 
 //-
 // Check llvm-spirv- is used if it is found in PATH.
+//
+// This test uses the PATH environment variable; on Windows, we may need to 
retain
+// the original path for the built Clang binary to be able to execute (as it is
+// used for locating dependent DLLs). Therefore, skip this test on 
system-windows.
+//
 // RUN: mkdir -p %t/versioned
 // RUN: touch %t/versioned/llvm-spirv-%llvm-version-major \
 // RUN:   && chmod +x %t/versioned/llvm-spirv-%llvm-version-major
-// RUN: env "PATH=%t/versioned" %clang -### --target=spirv64 -x cl -c %s 2>&1 \
-// RUN:   | FileCheck -DVERSION=%llvm-version-major --check-prefix=VERSIONED %s
+// RUN: %if !system-windows %{ env "PATH=%t/versioned" %clang -### 
--target=spirv64 -x cl -c %s 2>&1 \
+// RUN:   | FileCheck -DVERSION=%llvm-version-major --check-prefix=VERSIONED 
%s %}
 
 // VERSIONED: {{.*}}llvm-spirv-[[VERSION]]

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] [test] Skip a test that sets PATH= on Windows (PR #95096)

2024-06-11 Thread Fangrui Song via cfe-commits

https://github.com/MaskRay approved this pull request.


https://github.com/llvm/llvm-project/pull/95096
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] [test] Skip a test that sets PATH= on Windows (PR #95096)

2024-06-11 Thread Fangrui Song via cfe-commits


@@ -77,13 +77,3 @@
 
 // XTOR: {{llvm-spirv.*"}}
 // BACKEND-NOT: {{llvm-spirv.*"}}
-
-//-
-// Check llvm-spirv- is used if it is found in PATH.
-// RUN: mkdir -p %t/versioned
-// RUN: touch %t/versioned/llvm-spirv-%llvm-version-major \
-// RUN:   && chmod +x %t/versioned/llvm-spirv-%llvm-version-major
-// RUN: env "PATH=%t/versioned" %clang -### --target=spirv64 -x cl -c %s 2>&1 \

MaskRay wrote:

Instead of creating a file, consider `%if !system-windows` 

https://github.com/llvm/llvm-project/pull/95096
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] [test] Skip a test that sets PATH= on Windows (PR #95096)

2024-06-11 Thread Martin Storsjö via cfe-commits

https://github.com/mstorsjo edited 
https://github.com/llvm/llvm-project/pull/95096
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] [test] Skip a test that sets PATH= on Windows (PR #95096)

2024-06-11 Thread Martin Storsjö via cfe-commits

https://github.com/mstorsjo updated 
https://github.com/llvm/llvm-project/pull/95096

From 8e5e09f12124a361c06d833a9ade75bbb338be4c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= 
Date: Tue, 11 Jun 2024 13:14:47 +0300
Subject: [PATCH] [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 a65771fce4a2f25f16d4b3918ad6a11370637f7b, 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.
---
 clang/test/Driver/spirv-toolchain-version.cl | 14 ++
 clang/test/Driver/spirv-toolchain.cl | 10 --
 2 files changed, 14 insertions(+), 10 deletions(-)
 create mode 100644 clang/test/Driver/spirv-toolchain-version.cl

diff --git a/clang/test/Driver/spirv-toolchain-version.cl 
b/clang/test/Driver/spirv-toolchain-version.cl
new file mode 100644
index 0..b23c2b9ef5558
--- /dev/null
+++ b/clang/test/Driver/spirv-toolchain-version.cl
@@ -0,0 +1,14 @@
+/// This test uses the PATH environment variable; on Windows, we may need to 
retain
+/// the original path for the built Clang binary to be able to execute (as it 
is
+/// used for locating dependent DLLs).
+// UNSUPPORTED: system-windows
+
+//-
+// Check llvm-spirv- is used if it is found in PATH.
+// RUN: mkdir -p %t/versioned
+// RUN: touch %t/versioned/llvm-spirv-%llvm-version-major \
+// RUN:   && chmod +x %t/versioned/llvm-spirv-%llvm-version-major
+// RUN: env "PATH=%t/versioned" %clang -### --target=spirv64 -x cl -c %s 2>&1 \
+// RUN:   | FileCheck -DVERSION=%llvm-version-major --check-prefix=VERSIONED %s
+
+// VERSIONED: {{.*}}llvm-spirv-[[VERSION]]
diff --git a/clang/test/Driver/spirv-toolchain.cl 
b/clang/test/Driver/spirv-toolchain.cl
index de818177cb19f..db3ee4d3fe02f 100644
--- a/clang/test/Driver/spirv-toolchain.cl
+++ b/clang/test/Driver/spirv-toolchain.cl
@@ -77,13 +77,3 @@
 
 // XTOR: {{llvm-spirv.*"}}
 // BACKEND-NOT: {{llvm-spirv.*"}}
-
-//-
-// Check llvm-spirv- is used if it is found in PATH.
-// RUN: mkdir -p %t/versioned
-// RUN: touch %t/versioned/llvm-spirv-%llvm-version-major \
-// RUN:   && chmod +x %t/versioned/llvm-spirv-%llvm-version-major
-// RUN: env "PATH=%t/versioned" %clang -### --target=spirv64 -x cl -c %s 2>&1 \
-// RUN:   | FileCheck -DVERSION=%llvm-version-major --check-prefix=VERSIONED %s
-
-// VERSIONED: {{.*}}llvm-spirv-[[VERSION]]

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] [test] Skip a test that sets PATH= on Windows (PR #95096)

2024-06-11 Thread Martin Storsjö via cfe-commits

mstorsjo wrote:

> Could the single test with the PATH manipulation be moved to a separate test 
> file which is disabled on Windows? That way we could keep running the other 
> tests on Windows.

That's certainly an option, too.

https://github.com/llvm/llvm-project/pull/95096
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] [test] Skip a test that sets PATH= on Windows (PR #95096)

2024-06-11 Thread Henry Linjamäki via cfe-commits

linehill wrote:

Could the single test with the PATH manipulation be moved to a separate test 
file which is disabled on Windows? That way we could keep running the other 
tests on Windows.

https://github.com/llvm/llvm-project/pull/95096
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] [test] Skip a test that sets PATH= on Windows (PR #95096)

2024-06-11 Thread via cfe-commits

llvmbot wrote:



@llvm/pr-subscribers-clang-driver

@llvm/pr-subscribers-clang

Author: Martin Storsjö (mstorsjo)


Changes

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 a65771fce4a2f25f16d4b3918ad6a11370637f7b, 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.

---
Full diff: https://github.com/llvm/llvm-project/pull/95096.diff


1 Files Affected:

- (modified) clang/test/Driver/spirv-toolchain.cl (+5) 


``diff
diff --git a/clang/test/Driver/spirv-toolchain.cl 
b/clang/test/Driver/spirv-toolchain.cl
index de818177cb19f..2c9f9db80cad6 100644
--- a/clang/test/Driver/spirv-toolchain.cl
+++ b/clang/test/Driver/spirv-toolchain.cl
@@ -1,3 +1,8 @@
+/// One test uses the PATH environment variable; on Windows, we may need to 
retain
+/// the original path for the built Clang binary to be able to execute (as it 
is
+/// used for locating dependent DLLs).
+// UNSUPPORTED: system-windows
+
 // Check object emission.
 // RUN: %clang -### --target=spirv64 -x cl -c %s 2>&1 | FileCheck 
--check-prefix=SPV64 %s
 // RUN: %clang -### --target=spirv64 %s 2>&1 | FileCheck --check-prefix=SPV64 
%s

``




https://github.com/llvm/llvm-project/pull/95096
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] [test] Skip a test that sets PATH= on Windows (PR #95096)

2024-06-11 Thread Martin Storsjö via cfe-commits

mstorsjo wrote:

CC @linehill 

https://github.com/llvm/llvm-project/pull/95096
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] [test] Skip a test that sets PATH= on Windows (PR #95096)

2024-06-11 Thread Martin Storsjö via cfe-commits

https://github.com/mstorsjo created 
https://github.com/llvm/llvm-project/pull/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 a65771fce4a2f25f16d4b3918ad6a11370637f7b, 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.

From 1608c828eaeb6ca37702817384930fa44b0612f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= 
Date: Tue, 11 Jun 2024 13:14:47 +0300
Subject: [PATCH] [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 a65771fce4a2f25f16d4b3918ad6a11370637f7b, 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.
---
 clang/test/Driver/spirv-toolchain.cl | 5 +
 1 file changed, 5 insertions(+)

diff --git a/clang/test/Driver/spirv-toolchain.cl 
b/clang/test/Driver/spirv-toolchain.cl
index de818177cb19f..2c9f9db80cad6 100644
--- a/clang/test/Driver/spirv-toolchain.cl
+++ b/clang/test/Driver/spirv-toolchain.cl
@@ -1,3 +1,8 @@
+/// One test uses the PATH environment variable; on Windows, we may need to 
retain
+/// the original path for the built Clang binary to be able to execute (as it 
is
+/// used for locating dependent DLLs).
+// UNSUPPORTED: system-windows
+
 // Check object emission.
 // RUN: %clang -### --target=spirv64 -x cl -c %s 2>&1 | FileCheck 
--check-prefix=SPV64 %s
 // RUN: %clang -### --target=spirv64 %s 2>&1 | FileCheck --check-prefix=SPV64 
%s

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits