Commit Graph

8301 Commits

Author SHA1 Message Date
Alex Rønne Petersen 48d5b66677 std.Target: fuchsia supports arm/thumb now 2026-04-25 21:49:38 +02:00
Andrew Kelley fb9ba5e4b3 Merge pull request 'llvm: fix multiple_llvm_types handling and aarch64 return types' (#32028) from aarch64-c-abi into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32028
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-25 05:19:18 +02:00
Matthew Lugg 99b90a4315 incremental: add misssing dependency on backing/tag type source code 2026-04-23 01:13:22 +02:00
rpkak 03955476ad zigc: test and fix strtol and similar 2026-04-22 19:30:39 +02:00
Jacob Young df3aba6cc0 llvm: fix multiple_llvm_types handling and aarch64 return types
Closes #31994
2026-04-22 13:19:44 -04:00
Jacob Young ea45895a2d tests: cleanup c abi test runner 2026-04-22 13:19:44 -04:00
Jacob Young c0e90312fc test: c abi regression tests for aarch64 failures 2026-04-22 14:35:22 +02:00
Chris Boesch 3ea77badf9 libc: strdup, strndup, wcsdup (#31935)
Contributes to: #30978

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31935
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-22 01:57:58 +02:00
Pavel Verigo 22945fbbdc stage2-wasm: vector, std tests 2026-04-22 00:19:46 +02:00
Pavel Verigo 36faf76fe1 AstGen: add missing addRestoreErrRetIndex calls when handling for/while expr
Fixes #30912
2026-04-22 00:17:52 +02:00
GasInfinity f8e9593851 fix: wasm requires strict function prototypes
* `pthread_mutex_*` and friends are also invalid then but they're not
  currently tested (and there's no wasi prong in `pthread_mutex_t`)
2026-04-21 14:45:24 +02:00
GasInfinity 61cd38e8ac feat(libzigc): add common implementations of pthread_spin_*
* and remove their mingw, musl and wasi implementations
2026-04-21 09:03:06 +02:00
Alex Rønne Petersen 6612e7cdb2 libzigc: skip tests that are failing under various targets/conditions 2026-04-17 15:08:23 +02:00
Alex Rønne Petersen 7ea8f842bc libzigc: move all unit tests from lib/c/ to test/c/
Before:

* test-zigc: run libzigc unit tests (part of test-modules)
* test-libc: run libc-test cases

Now:

* test-libc: run libc API unit tests (part of test-modules)
* test-libc-nsz: run libc-test cases

libc API unit tests (previously referred to as libzigc unit tests) now run for
all supported targets, even those we don't provide libzigc for. The idea is that
this will help us catch bad assumptions in the unit tests, as well as bugs in
other libcs.

I considered this setup:

* test-c: run libc API unit tests (part of test-modules)
* test-libc-nsz: run libc-test cases
* test-libc: both of the above

However, I do not like it because it gives a false sense of security; the full
module and C ABI test suites are still liable to catch libzigc bugs that test-c
and test-libc-nsz might not. So contributors should just run the test steps
outlined in https://codeberg.org/ziglang/zig/issues/30978.

Co-authored-by: rpkak <rpkak@noreply.codeberg.org>
2026-04-17 12:10:37 +02:00
Alex Rønne Petersen 3e1e625814 test: handle -Dskip-libc correctly for module tests
For a test target with link_libc = null, we need to skip it if we would
implicitly link libc because the target requires it or because we don't yet have
a syscall layer for it.
2026-04-17 12:10:37 +02:00
Alex Rønne Petersen 5464392e11 std.os: add APIs to determine whether Zig std requires libc for a target
This is distinct from the question of whether the target formally considers libc
to be the only stable syscall interface; for example, FreeBSD and NetBSD have
stable syscalls, but we don't yet have syscall layers for them in std.os.
2026-04-17 12:07:57 +02:00
Alex Rønne Petersen adb1f3efc2 Merge pull request 'test: reinstate compiler-rt and zigc tests with different LLVM bug workarounds' (#31909) from alexrp/zig:reinstate-tests into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31909
2026-04-17 12:04:30 +02:00
Andrew Kelley bea4ea5ff8 Merge pull request 'zigc: long double: call double function if long double and double are equivalent' (#31775) from rpkak/zig:zigc-long-double into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31775
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-16 19:57:54 +02:00
Alex Rønne Petersen 504ebf85c4 test: reinstate compiler-rt and zigc tests with different LLVM bug workarounds
ref https://codeberg.org/ziglang/zig/issues/31701
ref https://codeberg.org/ziglang/zig/issues/31702
2026-04-16 19:28:59 +02:00
mlugg d0226ac301 Merge pull request 'incremental: fix tracking of nested container declarations (and of opaque types)' (#31889) from dont-track-children-if-lost-parent into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31889
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-16 09:50:26 +02:00
rpkak f564a7733c remove code, which is only reached if c_longdouble is only 16 or 32 bits big 2026-04-16 07:05:31 +02:00
Andrew Kelley 67a5b6e5e8 delete @cImport from the language
closes #20630
2026-04-15 17:43:53 -07:00
badayvedat a05a25e2bb zig libc: export fdiml and fdimf (#31759)
Exports `fdiml` and `fdimf` in zig libc and removes from from musl and mingw libc.

Contributes to: https://codeberg.org/ziglang/zig/issues/30978

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31759
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: badayvedat <badayvedat@gmail.com>
Co-committed-by: badayvedat <badayvedat@gmail.com>
2026-04-16 01:11:04 +02:00
K4 bf40264941 add test for comptime-only functions 2026-04-16 01:04:41 +02:00
Matthew Lugg 6608b65100 incremental: fix tracking of nested container declarations
...but not in the way you'd expect. We were actually tracking them in
cases where we shouldn't have been! We cannot track a declaration if its
parent namespace has been lost, because that will cause analysis
failures immediately, but if we excluded a type from the mapping due to
a major change (such as a struct turning into a union, or a field being
added), we were still including any trackable instructions inside the
container's field expressions (e.g. struct field type expressions). This
meant we were tracking a type declaration while losing tracking on its
parent namespace, with predictably disastrous results.

Oh, also, tracking for opaque types was just totally wrong (I think this
was a typo from a while back). We could map it to things other than
opaque declarations, and we never mapped declarations inside opaques.
So, uh, I fixed that too.
2026-04-16 00:00:44 +01:00
Andrew Kelley e00b5daa1f Merge pull request 'stage2-wasm: finish bigint support' (#31784) from pavelverigo/zig:wasm-bigint-finish into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31784
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-15 23:07:40 +02:00
Pavel Verigo c32f7a4513 stage2-wasm: support assembly 2026-04-15 22:57:41 +02:00
Matthew Lugg 291addadf8 tests: move incremental target matrix out of manifests
Having the matrix of test targets for incremental compilation in the
individual test manifests has turned out to be inconvenient for a few
reasons: the tests are almost certain to accidentally get out of sync,
disabling targets entirely is annoying to do, and incr-check needs to
take care to print the target in all error messages (which currently
does not always happen).

If I recall correctly, I originally designed it this way because it
allows targets to be disabled at the granularity of individual tests,
but there's an easier approach to that: just let a test manifest that it
should be *skipped* on a certain target! As skipping is the rare case,
and also the case you want readers to notice, it makes sense for *it* to
be explicitly specified, like how unit tests use `error.SkipZigTest`.

So, `incr-check` no longer runs through a list of targets specified in
the manifest. Instead, it accepts (and, in fact, requires) a single
target on the command line, and runs the test for that specific target.
If the file contains a `#skip_target` directive for that target, then
`incr-check` exits immediately, so we can still disable targets at
individual test granularity, but you can also disable a target for all
tests by just commenting it out of the matrix in `test/tests.zig`.

As a nice bonus, this also allows the build system to run different
incremental test targets in parallel, because the targets are now
different steps.

This definitely seems like a better way to split the work between the
build system and incr-check---sorry for getting this wrong initially!
2026-04-15 00:06:18 +02:00
Mason Remaley 6707a5efee Arena allocates text 2026-04-13 01:30:14 -07:00
Mason Remaley df2413cf69 Removes dead code, updates some tests, fixes typos in comments, formats 2026-04-12 04:01:30 -07:00
Mason Remaley 541bd6c369 Updates more failing tests 2026-04-12 04:01:30 -07:00
Mason Remaley ac207073f3 Reverts renaming of builtin.StackTrace -> ErrorReturnTrace
We can defer this change until the next time zig1 needs to be updated
2026-04-12 04:01:30 -07:00
Mason Remaley 9edbf00ddf Enables disabled error trace test on Windows 2026-04-12 04:01:30 -07:00
Mason Remaley 825ba5a350 Adds tests for inline traces 2026-04-12 04:01:30 -07:00
Mason Remaley dcdb562c15 Adds support for running the trace tests through darling, fixes compilation errors in MachO due to interface change 2026-04-12 04:01:30 -07:00
Mason Remaley 492efd4c06 Adds support for running stack and error trace tests through Wine
Also fixes minor bug that was preventing existing tests from passing on
32 bit Windows
2026-04-12 04:01:30 -07:00
Mason Remaley 94ff38af87 Separates error return traces from stack traces
Doesn't commit the changes to stage1, we can generate those at the end
once we're not making any more changes to it to avoid wasting storage.
2026-04-12 04:01:29 -07:00
David Rubin 06ab4f702e llvm: correctly bitcast for memset intrinsic path 2026-04-12 05:28:54 +02:00
Andrew Kelley 2322d45d80 Merge pull request 'Implement variadic functions for Win64 in the x86_64 backend' (#31672) from kcbanner/zig:win64_varargs into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31672
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-12 01:34:16 +02:00
Carl Åstholm c61e18006f Add standalone tests for debug I/O color detection 2026-04-11 12:28:24 -07:00
kcbanner 91dce64d10 - Fixup != .stage2_x86_64 -> == .stage2_llvm in var_args tests 2026-04-11 14:53:55 -04:00
Andrew Kelley 29225ae11b Merge pull request 'x64_86 fix: RMI can accept imm16 only for imul r16,r/m16' (#31234) from mathk/zig:x64_86-misscompfix-rmi16 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31234
Reviewed-by: jacobly <jacobly@noreply.codeberg.org>
2026-04-11 18:08:07 +02:00
Andrew Kelley cbe468a787 Merge pull request 'Sema: allow @round, @floor, @ceil, and @trunc to coerce to integer types' (#30906) from adria/zig:sema-rounding-casts into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30906
2026-04-11 16:44:41 +02:00
Alex Rønne Petersen 8d42a86fb3 test: add powerpc64-ps3-none and x86_64-(ps4,ps5)-none to llvm_targets 2026-04-11 12:55:45 +02:00
Alex Rønne Petersen 3898c815ac test: add mipsel-psp-eabihf to llvm_targets 2026-04-11 12:55:45 +02:00
Alex Rønne Petersen d626dc84d9 test: add s390x-linux-musl to llvm_targets 2026-04-11 12:06:50 +02:00
Alex Rønne Petersen 13839127b9 test: disable incremental tests on wasm32-wasi-selfhosted
https://codeberg.org/ziglang/zig/issues/31810
2026-04-11 04:40:16 +02:00
glowsquid 8111d3d63c fix comptime @ptrcasting from a larger type to a smaller one (#31774)
closes #30180

Note from mlugg: this fix is very much a hack, but it definitely won't break anything and it demonstrably fixes one case, so I'm merging it for now with the expectation that I'll be replacing the broken code soon.

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31774
Reviewed-by: mlugg <mlugg@noreply.codeberg.org>
Co-authored-by: glowsquid <sachabarsayuracko@gmail.com>
Co-committed-by: glowsquid <sachabarsayuracko@gmail.com>
2026-04-10 23:31:21 +02:00
David 2c6e5006ed Sema: fix comptime @ptrCast to optional slices 2026-04-10 23:27:13 +02:00
Mathieu Suen 244f5aafca fixup! Adding unwrapped error multiply regression test 2026-04-10 23:23:33 +02:00