7969 Commits

Author SHA1 Message Date
Alex Rønne Petersen
9ae8c48fdf
test: put soft float powerpc targets behind -Dtest-extra-targets 2025-10-17 02:15:48 +02:00
Alex Rønne Petersen
7215249aa9
test: put all n32 and x32 targets behind -Dtest-extra-targets 2025-10-17 02:13:31 +02:00
Alex Rønne Petersen
ca2da421dd
test: put all dynamic musl targets behind -Dtest-extra-targets 2025-10-17 02:03:02 +02:00
xdBronch
f785e4745d detect invalid @bitCast with arrays 2025-10-16 19:36:11 +01:00
Alex Rønne Petersen
70c21fdbab
libc-test: disable utime.c
Fails under heavy load in CI; futimens() effects aren't reflected in the
subsequent fstat() call for some reason.
2025-10-15 10:58:30 +02:00
Jacob Young
cc3c4d1069 windows: workaround kernel race condition in more places 2025-10-14 23:16:36 -04:00
Alex Rønne Petersen
4edebf40d5
Merge pull request #25402 from alexrp/libc-test-ci
`ci`: enable running libc-test on `x86_64-linux-release`
2025-10-14 21:29:57 +02:00
Jacob Young
958faa7031 windows: workaround kernel race condition the most 2025-10-12 13:55:57 -04:00
Jacob Young
95242cc431 windows: workaround kernel race condition even more 2025-10-11 12:17:39 -04:00
Jacob Young
8efcfeaf1e windows: workaround kernel race condition better
Until I can do more testing, we bump the numbers until morale improves.
2025-10-11 10:01:17 -04:00
Jacob Young
2e31077fe0 Coff: implement threadlocal variables 2025-10-10 22:47:47 -07:00
Jacob Young
b2bc6073c8 windows: workaround kernel race condition
This was causing flaky CI failures.
2025-10-10 22:47:36 -07:00
Alex Rønne Petersen
66193e72d3
test: disable test-link macho on FreeBSD
See also d6d1fef.

https://github.com/ziglang/zig/issues/25323
2025-10-11 00:40:42 +02:00
Andrew Kelley
8964737ffc build.zig: add -Dtest-default-only option
handy during development when it is already known that not all tests
will pass.
2025-10-08 16:43:42 -07:00
xdBronch
60be67d3c0 don't make OPV tuple fields comptime 2025-10-08 18:04:25 +01:00
xdBronch
2c0aa1c6f5 don't make anonymous tuple fields referencing comptime vars comptime 2025-10-07 22:13:10 +01:00
xdBronch
2810e4b173 detect references to comptime var in default values and sentinels 2025-10-07 11:58:12 +01:00
xdBronch
851ae9bb43 don't pass zero-length @memset to the backend 2025-10-06 11:28:56 -07:00
Alex Rønne Petersen
ddc815e3d8 drop support for powerpc64 ELF v1
* ELF v1 on powerpc64 is only barely kept on life support in a couple of Linux
  distros. I don't anticipate that this will last much longer.
* Most of the Linux world has moved to powerpc64le which requires ELF v2.
* Some Linux distros have even started supporting powerpc64 with ELF v2.
* The BSD world has long since moved to ELF v2.
* We have no actual linking support for ELF v1.
* ELF v1 had confused DWARF register mappings which is becoming a problem in
  our DWARF code in std.debug.

It's clear that ELF v1 is on its way out, and we never fully supported it
anyway. So let's not waste any time or energy on it going forward.

closes #5927
2025-10-06 01:28:56 +02:00
Alex Rønne Petersen
606c7bcc89
test: disable standalone tsan test
https://github.com/ziglang/zig/issues/25471
2025-10-05 02:13:21 +02:00
Alex Rønne Petersen
ea46bd2772
test: move standalone/options/ to cli/options/
It's now used only by test-cli, so make that clear.
2025-10-04 21:55:39 +02:00
Alex Rønne Petersen
5bbbc8d299
Revert "test: remove standalone options test"
This reverts commit d9cd4d087648c6d83e22dda6a4b82929a72fc771.

Turns out Jacob restored this test as part of test-cli in cdba1d5.
2025-10-04 21:46:55 +02:00
Alex Rønne Petersen
3539cad176
test: remove standalone sigpipe test
This should be restored, but there's no point keeping disabled code that's just
going to bitrot.

https://github.com/ziglang/zig/issues/25466
2025-10-04 20:53:19 +02:00
Alex Rønne Petersen
d9cd4d0876
test: remove standalone options test
This functionality is already load-bearing for the compiler's own build script
so this (disabled, possibly bitrotted?) doesn't really add value.
2025-10-04 20:51:07 +02:00
Alex Rønne Petersen
f6c1864abf
test: remove standalone issue_13970 test
It's been disabled for ages and has bitrotted. Someone can readd it later if
they feel like it actually adds value.
2025-10-04 20:51:07 +02:00
Alex Rønne Petersen
95417948d0
test: remove ad-hoc nvptx tests
These were just testing random things in the LLVM NVPTX backend. That's not
really our job.
2025-10-04 20:51:07 +02:00
Alex Rønne Petersen
c68f9bc207
test: remove some tests that are now covered well enough by test-stack-traces
The amount of cross compilation required for these tests was too time-consuming
for how much value they added. test-stack-traces now cover these well enough,
especially as we add more exotic machines to the CI fleet to run native tests.
2025-10-04 20:51:07 +02:00
Jacob Young
07c3f9ef8e x86_64: fix bool vector init register clobber
Closes #25439
2025-10-03 12:18:53 -04:00
Jacob Young
e1f3fc6ce2 Coff2: create a new linker from scratch 2025-10-02 17:44:52 -04:00
Jacob Young
d5f09f56e0 x86_64: fix windows calling convention abi 2025-10-02 15:59:51 -04:00
Alex Rønne Petersen
9327aaefb6
test: disable an error trace test on optimized riscv64-linux 2025-10-01 12:58:20 +02:00
Alex Rønne Petersen
f049ae6d57
libc-test: set a 1.6G max_rss for each test case
1.4G was the highest value I observed for any test case on x86_64-linux. This
change should prevent OOM conditions in CI.
2025-10-01 03:25:13 +02:00
Alex Rønne Petersen
e5ebdf9e41
libc-test: disable malloc-oom.c
This causes QEMU to OOM in CI.
2025-10-01 03:25:13 +02:00
Alex Rønne Petersen
d97954a8ea
test: remove stack_iterator standalone test
Our new stack trace tests cover all the important parts of this.
2025-10-01 01:06:13 +02:00
Alex Rønne Petersen
5a71e15f1f
test: don't run error/stack trace tests on self-hosted on BSDs
See: 0700ec35bda705fccb61cb3f28734ce11166fda5
2025-10-01 01:06:10 +02:00
Alex Rønne Petersen
43806cf0bd
test: disable an error trace test on optimized x86_64-freebsd and loongarch64-linux 2025-10-01 01:06:07 +02:00
mlugg
1120546f72
std.debug.SelfInfo: remove shared logic
There were only a few dozen lines of common logic, and they frankly
introduced more complexity than they eliminated. Instead, let's accept
that the implementations of `SelfInfo` are all pretty different and want
to track different state. This probably fixes some synchronization and
memory bugs by simplifying a bunch of stuff. It also improves the DWARF
unwind cache, making it around twice as fast in a debug build with the
self-hosted x86_64 backend, because we no longer have to redundantly go
through the hashmap lookup logic to find the module. Unwinding on
Windows will also see a slight performance boost from this change,
because `RtlVirtualUnwind` does not need to know the module whatsoever,
so the old `SelfInfo` implementation was doing redundant work. Lastly,
this makes it even easier to implement `SelfInfo` on freestanding
targets; there is no longer a need to emulate a real module system,
since the user controls the whole implementation!

There are various other small refactors here in the `SelfInfo`
implementations as well as in the DWARF unwinding logic. This change
turned out to make a lot of stuff simpler!
2025-09-30 14:18:26 +01:00
mlugg
dbda011ae6
std.debug.SelfInfo: mark ARM unwinding as unsupported
We need to parse the `.ARM.exidx` section to be able to reliably unwind
the stack on ARM.
2025-09-30 13:44:56 +01:00
mlugg
2ab650b481
std.debug: go back to storing return addresses instead of call addresses
...and just deal with signal handlers by adding 1 to create a fake
"return address". The system I tried out where the addresses returned by
`StackIterator` were pre-subtracted didn't play nicely with error
traces, which in hindsight, makes perfect sense. This definition also
removes some ugly off-by-one issues in matching `first_address`, so I do
think this is a better approach.
2025-09-30 13:44:55 +01:00
mlugg
0c24b8ec66
update to new std.debug changes 2025-09-30 13:44:55 +01:00
mlugg
3a9c680ad7
std: allow disabling stack tracing
This option disables both capturing and printing stack traces. The
default is to disable if debug info is stripped.
2025-09-30 13:44:55 +01:00
mlugg
e9c0d43c5b
test-error-traces: skip some more optimized traces 2025-09-30 13:44:54 +01:00
mlugg
2fefe0e4b3
tests: fix 32-bit compatible arch selection 2025-09-30 13:44:54 +01:00
mlugg
f5c8d80e08
windows_bat_args: fix path handling
The input path could be cwd-relative, in which case it must be modified
before it is written into the batch script.

Also, remove usage of deprecated `GeneralPurposeAllocator` alias, rename
`allocator` to `gpa`, use unmanaged `ArrayList`.
2025-09-30 13:44:54 +01:00
mlugg
4cb84f8e48
test-standalone: update for std.debug changes 2025-09-30 13:44:54 +01:00
mlugg
5f00738969
test-stack-traces: fix on x86-windows 2025-09-30 13:44:53 +01:00
mlugg
cf13b40946
test-stack-traces: don't try to strip unwind tables on x86-windows 2025-09-30 13:44:53 +01:00
mlugg
1a8a8c610d
tests: split up and enhance stack trace tests
Previously, the `test-stack-traces` step was essentially just testing
error traces, and even there we didn't have much coverage. This commit
solves that by splitting the "stack trace" tests into two separate
harnesses: the "stack trace" tests are for actual stack traces (i.e.
involving stack unwinding), while the "error trace" tests are
specifically for error return traces.

The "stack trace" tests will test different configurations of:

* `-lc`
* `-fPIE`
* `-fomit-frame-pointer`
* `-fllvm`
* unwind tables (currently disabled)
* strip debug info (currently disabled)

The main goal there is to test *stack unwinding* under different
conditions. Meanwhile, the "error trace" tests will test different
configurations of `-O` and `-fllvm`; the main goal here, aside from
checking that error traces themselves do not miscompile, is to check
whether debug info is still working even in optimized builds. Of course,
aggressive optimizations *can* thwart debug info no matter what, so as
before, there is a way to disable cases for specific targets / optimize
modes.

The program which converts stack traces into a more validatable format
by removing things like addresses (previously `check-stack-trace.zig`,
now `convert-stack-trace.zig`) has been rewritten and simplified. Also,
thanks to various fixes in this branch, several workarounds have become
unnecessary: for instance, we don't need to ignore the function name
printed in stack traces in release modes, because `std.debug.Dwarf` now
uses the correct DIE for inlined functions!

Neither `test-stack-traces` nor `test-error-traces` does general foreign
architecture testing, because it seems that (at least for now) external
executors often aren't particularly good at handling stack tracing
correctly (looking at you, Wine). Generally, they just test the native
target (this matches the old behavior of `test-stack-traces`). However,
there is one exception: when on an x86_64 or aarch64 host, we will also
test the 32-bit version (x86 or arm) if the OS supports it, because such
executables can be trivially tested without an external executor.

Oh, also, I wrote a bunch of stack trace tests. Previously there was,
erm, *one* test in `test-stack-traces` which wasn't for error traces.
Now there are a good few!
2025-09-30 13:44:53 +01:00
Jacob Young
a744fbd22f x86_64: fix ~/! miscomps 2025-09-27 18:30:52 -04:00
mlugg
237e8a5a7a tests: fix redundant target in matrix
Because -fno-llvm is now the default on x86_64-linux, this target was
exactly equivalent to one specified earlier in the matrix. This was
probably just missed when doing the work to enable the self-hosted
backend by default for x86_64.
2025-09-27 18:30:52 -04:00