85 Commits

Author SHA1 Message Date
Martin Storsjö 8220db557f run-tests: Use mingw32-make in busybox
This is the make tool we'd expect to use in such a setup.
2026-01-08 11:34:24 +02:00
Martin Storsjö 90633bc87b run-tests: Add busybox specific logic for figuring out what architectures we can execute 2026-01-08 11:34:24 +02:00
Martin Storsjö 322c941069 run-tests: Use "uname" instead of "uname -s"
"-s" is the default option if none is specified.

This improves consistency with other uses of "uname" in the
scripts.
2025-12-16 11:50:36 +02:00
Martin Storsjö 309cdd5690 run-tests: Improve a comment 2025-12-16 11:50:23 +02:00
Martin Storsjö 81e6861ff6 run-tests: Skip running emulated x86 binaries on aarch64, when targeting msvcrt
In this configuration, one test in crt-test.c fails, both for
i686 and x86_64, when running emulated on aarch64.
2025-09-14 00:04:55 +03:00
Martin Storsjö 2ec690d08e Revert "run-tests: Skip testing arm64ec in msvcrt builds"
This reverts commit 056dd7329b.

In the current versions of mingw-w64, it is possible to build
the tests for arm64ec with msvcrt.dll as well.
2025-09-11 15:49:27 +03:00
Martin Storsjö 056dd7329b run-tests: Skip testing arm64ec in msvcrt builds
It is currently known to fail to link some tests.
2025-07-18 19:47:28 +03:00
Martin Storsjö 4a6030a850 run-tests: Execute arm64ec tests on Windows 11 on aarch64 2025-07-17 22:49:10 +03:00
Martin Storsjö 4700b4f7bb test: Skip building the ubsan and openmp tests for arm64ec
Also unset RUN for arm64ec, instead of accidentally inheriting the
earlier value.
2025-07-17 22:49:10 +03:00
Martin Storsjö cb92de78e7 Include arm64ec in the lists of all architectures
Since LLVM 21.x, the upstream support for ARM64EC in LLD and
compiler-rt is complete enough for us to be able to build it.
2025-07-17 22:48:39 +03:00
Martin Storsjö e21ad3bba2 run-tests, test-libcxx-module: Extend checks for MSYS to also check for CYGWIN 2025-04-21 14:31:57 +03:00
Martin Storsjö b8ef2ab96e run-tests: Inspect the Windows build number on WSL
Co-authored-by: Jeremy Drake <github@jdrake.com>
2025-04-21 14:31:57 +03:00
Martin Storsjö 81434376ae run-tests: Detect if running on WSL
Set the right variables needed for running tests in this configuration,
and try to guess which architectures can be executed.
2025-04-21 14:31:48 +03:00
Jeremy Drake 7ba0232841 run-tests: Inspect the msys2 "uname" output
While msys2 itself may be x86_64 running emulated, it still does
indicate whether the host machine runs ARM64 (since recent
changes in https://github.com/msys2/msys2-runtime/pull/244 and
https://github.com/msys2/msys2-runtime/pull/245).

The msys2 uname command also exposes the Windows build number,
which allows determining whether armv7 and/or x86_64 binaries
can be executed.
2025-04-21 14:30:42 +03:00
Martin Storsjö 11c51c62d4 run-tests: Rewrite detection of what tests we can try to execute
Autodetect whether we can run tests in Wine on unix.
2025-04-21 14:30:12 +03:00
Martin Storsjö 0b296aefc0 run-tests: Skip asan tests on msvcrt
Asan doesn't really run properly on msvcrt.dll; skip testing it
in that configuration.

See discussion on https://github.com/llvm/llvm-project/pull/120397
and https://github.com/mstorsjo/llvm-mingw/issues/224 for context
around this.
2025-02-11 10:04:41 +02:00
Martin Storsjö 8dabd61494 test: Rename HAVE_SANITIZERS to HAVE_ASAN
Always run the ubsan tests; those should work on any architecture
now.
2025-02-11 10:02:57 +02:00
Martin Storsjö 9cb5206253 run-tests: Remove an ancient chceck for UCRT
It's enough to check for the _UCRT define these days, as long
as we are including a header that pulls in the base mingw headers.

Since 8b2ece59fccf0a65257b1ba2fe8d67d7e8a2e8c1 in mingw-w64 (May 6th
2019), the mingw-w64 headers define _UCRT. Since
94a28397eec79e54ce5a8354512f43da88f815d2 (committed on the same date),
the mingw-w64 headers use 0xE00 instead of 0x1400 for UCRT.
2025-02-11 10:00:36 +02:00
Martin Storsjö b592dd734e tests: Consistently use <triple>-gcc instead of <triple>-clang for cross compilation
While <triple>-clang is more specific, using <triple>-gcc allows
testing GCC based toolchains (somewhat) with the same scripts/makefiles
too.
2023-03-11 23:59:19 +02:00
Martin Storsjö dfd4c31f2e test: Simplify handling of OpenMP
It is available on all architectures by default now. Keep the
HAVE_OPENMP conditional within the test makefile to allow custom
testing without having it available.
2023-01-29 01:09:17 +02:00
Martin Storsjö 6b8725333a build-openmp: Build the OpenMP library on all architectures
Since a356782426f5bf54a00570e1f925345e5fda7b2e in llvm-project,
OpenMP can be built for mingw/aarch64, since
fb947c358661b3bd3d5e1fa776ec74cc0f308854 it should work correctly
in all currently tested cases, and since
97958c9bb83cec44b6ce13e732b53de0171a5d43 it can be built for
mingw/armv7.
2023-01-29 01:09:17 +02:00
Martin Storsjö 241a1cd148 test: Prepare the test scripts for testing native Windows tools via WSL
Use the TOOLEXT variable in run-tests.sh in the same way as in the
Makefile. The Makefile sets this variable automatically if invoked
by mingw32-make, but if running run-tests.sh in WSL with native
Windows compilers, then we need to set TOOLEXT manually when calling
run-tests.sh.

Allow skipping the cfguard failure tests when run in such a
configuration, since Linux make in WSL can't easily run cmd.exe
like in MSYS2.
2023-01-21 23:48:24 +02:00
Martin Storsjö e16ba0772f run-tests: Split out building and running of tests into a Makefile
This allows building and running the tests in parallel.
2022-10-29 23:22:56 +03:00
Martin Storsjö 710f2f055a run-tests: Rename HAS_CFGUARD to HAVE_CFGUARD
This picks a different naming style for flags like this.
2022-10-29 23:22:56 +03:00
Martin Storsjö 64dffd28a5 run-tests: Merge TESTS_CPP_LOAD_DLL back into TESTS_CPP
This was split in 591a5c2ddc since
we couldn't/shouldn't test these for UWP targets.

When the testing for UWP targets was reduced in
551b046498, there was no longer any
distinction between TESTS_CPP_LOAD_DLL and TESTS_CPP, so merge
them back.
2022-10-27 00:40:06 +03:00
Martin Storsjö c541aa87b8 run-tests: Fix a missed rename/split of RUN_X86
This was missed in 3eb7f64593.
2022-10-27 00:40:06 +03:00
Martin Storsjö 3eb7f64593 run-tests: Allow overriding the command for running separately for i686 and x86_64 2022-10-25 11:09:38 +03:00
Martin Storsjö 22b1ff128b Consistently use the --pdb= form in scripts
Stop using the separate argument form (-Wl,-pdb,<filename>), and
prefer using the option form with an implicit output name.
2022-10-12 15:28:45 +03:00
Alvin Wong 039ee72a68 Add CFGuard test 2022-10-01 13:25:52 +03:00
Martin Storsjö f4f25e241b run-tests: Verify that sanitizers and buffer/stack protections work as they should 2022-09-16 20:23:32 +03:00
Martin Storsjö b395a2f26b run-tests: Build and run crt-test with fortification 2022-09-16 20:23:32 +03:00
Martin Storsjö 4c29469eac test: Add a test for fortification of string functions
We currently only run the testcase where it doesn't trigger the
failed checks though.
2022-09-16 19:43:40 +03:00
Martin Storsjö 2013c9c165 run-tests: Swap the nesting of a loop/condition
There's no point in running the whole loop if each iteration is
going to be skipped.
2022-09-16 19:43:40 +03:00
Martin Storsjö 332193b7ec run-tests: Build the ubsan test case with -fno-sanitize-recover=all
This allows easier programmatic checking that the sanitizer actually
caught the tested issue, when triggering the issue.
2022-09-16 19:42:21 +03:00
Martin Storsjö fa02f14aea run-tests: Actually try to run the asan-instrumented test binaries
Previously we would just run the plain version of them.
2022-09-15 13:55:15 +03:00
Martin Storsjö 5456a77fe3 run-tests: Wipe out an older libunwind.dll in the same way as libc++.dll
Ideally we'd wipe the whole test/<arch> directory before running
the tests (we do that if CLEAN is set), but here we only wipe out
the specific ones that can affect how new tests are built and linked.
2022-09-15 13:54:51 +03:00
Martin Storsjö b6429b6632 run-tests: Move resetting of the TESTS_EXTRA variable earlier in the loop
A test that was added to TESTS_EXTRA in
e934c04ef4 wasn't actually ever
executed; this makes it be executed as expected.
2022-09-14 10:03:36 +03:00
Martin Storsjö 00abcdbe6a run-tests: Remove is-ucrt.c after testing 2022-04-08 09:44:56 +03:00
Martin Storsjö e2ad2d4b64 run-tests: Don't assume running on x86
Also use $COPY_X86 for consistency.
2021-07-01 22:36:54 +03:00
Martin Storsjö 1629861108 run-tests: Move a comment closer to the line it refers to 2021-07-01 22:36:54 +03:00
Martin Storsjö 0200472671 test: Add a testcase for cleanup of C++ destructors while doing longjmp
For x86_64 and aarch64, this requires https://reviews.llvm.org/D89231.

The C++ destructors aren't executed while doing the longjmp (contrary
to how it works MSVC's C++ exceptions), but it no longer crashes.
2021-04-15 11:36:20 +03:00
Martin Storsjö 790bc40855 test: Add a testcase for throwing/catching C++ exceptions across DLLs 2021-02-19 16:19:47 +02:00
Martin Storsjö 5533a5ad53 run-tests: Fix running with a relative path to the toolchain
This fixes github issue #181.
2021-01-25 14:45:34 +02:00
Martin Storsjö 2377f1a839 test: Explicitly test linking the C++ runtime statically 2020-10-23 12:17:35 +03:00
Martin Storsjö 9031eb6791 Build the OpenMP runtime in docker based builds
LLVM's OpenMP implementation only supports Windows on x86, and it
requires a MASM-compatible assembler to build it. Build UASM
for this purpose, for now. (UASM isn't available packaged in
debian/ubuntu repos.) In the future, llvm-ml should be able
to handle it instead, but it's not currently mature enough.

Not including it in the regular build-all.sh for now, as UASM
isn't generally available.
2020-10-15 23:23:05 +03:00
Martin Storsjö c82a6f2340 test: Add a testcase for the global termminate handler 2020-09-16 00:07:46 +03:00
Martin Storsjö 308f7227c5 test: Add an idl testcase 2020-09-16 00:03:57 +03:00
Martin Storsjö 63add77368 run-tests: Run exception tests on wine on aarch64 as well
Current git versions of wine can handle the exception unwinding
properly.
2020-09-16 00:03:57 +03:00
Martin Storsjö e934c04ef4 run-tests: Execute the uwp test executables now that they don't rely on vcruntime140_app 2020-06-16 11:32:17 +03:00
Martin Storsjö 8e461131cf Clean the build dirs before building, if the env var CLEAN is set 2020-03-25 23:24:31 +02:00