Commit Graph

8344 Commits

Author SHA1 Message Date
Alex Rønne Petersen 72966e2a7b disable some tests that fail on x86_64-macos
These might be Rosetta 2 bugs, but I have no way to actually check since we no
longer have any native x86_64-macos CI machines.
2026-05-09 08:49:34 +02:00
Justus Klausecker 6d0b887972 Sema: disallow pointer cast from pointer to opaque type to slice
Fixes a regression where this conversion crashes. When the conversion was
still possible it would produce a slice with a length of zero, which doesn't
really make a lot of sense either. There's no way to determine the length
of the destination slice from a pointer to an opaque type, so it's a compile
error now. Users should just cast to a many-item pointer and slice to the
desired length manually instead.
2026-05-07 06:25:43 +02:00
Matthew Lugg fecd28371d Sema: fix crash bitcasting undefined to bitpack type
Resolves: https://codeberg.org/ziglang/zig/issues/31944
2026-05-07 06:22:47 +02:00
Matthew Lugg fc1c83a363 Air: fix legalization of packed struct init with OPV field
I have verified that this fixes *both* of the reproductions given in
https://codeberg.org/ziglang/zig/issues/31837 (they were the same bug).

Resolves: https://codeberg.org/ziglang/zig/issues/31837
2026-05-07 06:21:59 +02:00
Matthew Lugg 0bcf29aff6 compiler: correct ABI size of comptime-only optional type
Resolves: https://codeberg.org/ziglang/zig/issues/31603
2026-05-07 06:21:30 +02:00
Andrew Kelley cd23f7a814 Merge pull request 'std.meta: Remove Int/Tuple in favor of @Int/@Tuple' (#35188) from linus/zig:deprecated-std-meta into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35188
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-05-06 19:35:40 +02:00
Alex Rønne Petersen 3e0dfe83ce drop support for powerpc-linux-gnueabi(hf)
These are the last PowerPC cross targets that still use the IBM 128-bit long
double format. I'm not convinced anyone cares enough about them to justify
keeping them around, so this drops support. powerpc-linux-musleabi(hf), which
use the IEEE format, are still fully supported for people who want to use old
32-bit PowerPC hardware.
2026-05-06 15:50:45 +02:00
mlugg 7eb79daffb Merge pull request 'std.builtin -> std.lang migration progress' (#32182) from compiler-std-lang into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32182
2026-05-06 10:10:44 +02:00
Pavel Verigo 3d1fb4fac8 stage2-wasm: disable std tests, add failing behavior tests 2026-05-04 07:40:02 +02:00
Linus Groh bf953c4d6a std.meta: Remove Tuple in favor of @Tuple 2026-05-03 21:42:06 +01:00
Linus Groh 991f56fd6b std.meta: Remove Int in favor of @Int 2026-05-03 21:42:06 +01:00
Matthew Lugg e133f793ee compiler: depend on 'std.lang' instead of 'std.builtin' 2026-05-03 12:23:29 +01:00
Andrew Kelley 04481c76cb Merge pull request 'Export wrapper around Zig DllMain function when linking libc + add tests' (#32179) from squeek502/zig:windows-dlls into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32179
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-05-02 20:06:56 +02:00
Justus Klausecker 1f22b2cbb2 LowerZon: fix packed containers
Since `packed` containers are now internally represented by a `bitpack`,
they need special handling on initialization: they need to be either
bitpacked or bitcasted to their backing integer. `Sema` already did this,
but `LowerZon` didn't yet.
2026-05-02 20:05:33 +02:00
Ryan Liptak a450016eb1 Add tests for DllMain to windows_entry_points standalone test 2026-05-02 02:44:26 -07:00
Alex Rønne Petersen 8eafca4c9b test: compile all JIT'd commands as part of test-cli 2026-05-01 00:53:39 +02:00
Matthew Lugg c144003fca tests: fix libc test with -Dno-matrix 2026-04-30 09:03:58 +01:00
Matthew Lugg fdac89d6cd remove uses of array multiplication
In preparation for its removal as accepted in
https://github.com/ziglang/zig/issues/24738.
2026-04-30 08:57:51 +01:00
Matthew Lugg 213c4fc25f lib,test: remove uses of i0
In preparation for its removal, as accepted in
https://github.com/ziglang/zig/issues/1593.
2026-04-30 08:57:51 +01:00
Matthew Lugg e67c344fc0 compiler,tests,tools: remove uses of capturing errdefer
In preparation for its removal, as accepted in
https://github.com/ziglang/zig/issues/23734.
2026-04-29 23:27:58 +01:00
Matthew Lugg 7b44e8986f Sema: remove void{} from the language
Because this syntax is not heavily used, and the migration can be done
with a simple text substitution, I do not believe a `zig fmt` fixup is
necessary for this change.

Resolves: https://github.com/ziglang/zig/issues/15213
2026-04-29 23:27:58 +01:00
Matthew Lugg 106850fd4c tests: remove uses of void{}
In preparation for this syntax to be removed from the language per
https://github.com/ziglang/zig/issues/15213.
2026-04-29 23:27:58 +01:00
mihael 764760df62 libzigc/math: Implement rintl, lrintl (#31791)
It's a fairly straightforward port of `musl`'s `rintl`, like `rint` and `rintf` were. `libc-test` tests for `rintl` are uncommented since they're now passing.

I've also covered special cases for `rint` with tests, and broke down the current `rint` and `modf` test declarations into multiple -- so each libc function get its own test declaration at the very least.

Contributes to #30978

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31791
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-27 16:48:55 +02:00
Alex Rønne Petersen 9f2f6aaef5 drop support for powerpc64-linux-gnu
glibc has never officially supported ELFv2 on big-endian PowerPC, and we do not
(and likely never will) support linking ELFv1. So just drop this target instead
of pretending we actually have anything resembling usable support for it. This
is a dying target anyway; IBM have been pushing people to powerpc64le for years
now, and most distros have dropped big endian.

glibc headers and abilists are not updated as part of this; I'll just let that
happen automatically on the next glibc update. Size savings are expected to be
very minimal anyway since there's large overlap between powerpc64 and
powerpc64le.

This commit also fixes a couple of bad assumptions in std.Target:

* The dynamic linker path should be /lib64/ld64.so.1. We should get this right
  even if the Zig compiler doesn't support the target.
* cCallingConvention() was picking powerpc64_elf_v2 only for musl targets. In
  reality, for the targets we support in std.Target, it should pick v2 for all
  except powerpc64-linux-gnu.

Finally, this switches LLVM codegen to use ELFv2 data layout for all targets
except ps3.
2026-04-26 19:24:46 +02:00
Matthew Lugg 8c5542bd38 incremental: add test for changing container kind
This used to trigger bugs, but works correctly as of Zig 0.16.0.

Resolves: https://github.com/ziglang/zig/issues/24217
2026-04-26 15:46:58 +02:00
Alex Rønne Petersen af40866628 test: re-enable std tests for dynamic powerpc-linux-musleabi and powerpc-linux-gnueabi 2026-04-26 14:45:57 +02:00
Alex Rønne Petersen 69fcca8556 test: disable a couple of failing C ABI tests on hexagon 2026-04-26 07:44:58 +02:00
Alex Rønne Petersen a83aad152b Merge pull request 'LLVM 22' (#32013) from llvm22 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32013
2026-04-26 07:03:38 +02:00
Andrew Kelley f0a7e3ccae Merge pull request 'fix more c abi bugs' (#32071) from c-abi-padding into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32071
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-26 04:22:38 +02:00
Andrew Kelley e7d74e49b0 declare linker test bankruptcy
The active contributors and maintainers of Zig's linker code have
generally found the current linker test harness to be cumbersome. The
tests require a lot of maintenance, but do not provide a lot of
coverage, and when they fail it is painful to troubleshoot.

Furthermore, as part of working on #31691, I don't want to port over the
CheckObject step, because I don't like the code anyway.

The plan forward is to start enhancing `zig objdump` to assist in
linker development, as well as using it as the basis for snapshot
testing.

We absolutely need linker test coverage, but we need to try to improve
these things about the next attempt:
* less effort to create and maintain tests
* less CPU overhead - we should be able to add a lot of tests without
  adding a lot of CI time.
* more helpful failures. A failed linker test should provide the next
  steps a developer can take to understand why the test failed.
* a goal of porting over all of LLD's test suite, or at least the good
  ones.

I'm not going to open an issue to track the lost linker test coverage,
because there was already so much lack of coverage for linker stuff.

However I will open issues to track this lost coverage:
* the deleted checks from test/standalone/glibc_compat/build.zig
* the deleted checks from test/standalone/compiler_rt_panic/build.zig
* the deleted checks from test/standalone/ios/build.zig
2026-04-26 00:15:07 +02:00
Alex Rønne Petersen d3ee286511 test: add loongarch64-linux-muslsf to test-c-abi matrix 2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 1bd9f3f4f2 test: add loongarch64-linux-(gnu,musl)sf to test-modules matrix 2026-04-25 21:54:48 +02:00
Alex Rønne Petersen a9fbcb7c67 test: add loongarch32-linux-none to test-modules matrix 2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 9ecf5b4603 test: add some loongarch32 targets to llvm_targets 2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 963c17f097 test: add hexagon-linux-musl to llvm_targets 2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 1af476d5d8 behavior: re-enable a bunch of behavior tests that now pass
closes https://github.com/ziglang/zig/issues/9660
closes https://github.com/ziglang/zig/issues/21050
closes https://github.com/ziglang/zig/issues/21090
closes https://github.com/ziglang/zig/issues/21091
2026-04-25 21:54:48 +02:00
Alex Rønne Petersen cc022047c3 Revert "test: disable hexagon-linux-musl C ABI tests for now"
This reverts commit fce7878a91.

The bug was fixed in LLVM 22.
2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 4eb8640213 Revert "test: skip alternative constraints behavior test on LoongArch"
This reverts commit f90548e740.

The bug was fixed in LLVM 22.
2026-04-25 21:54:48 +02:00
Alex Rønne Petersen a0ad35d0ba Revert "test: disable some vector ctz/clz behavior tests on LoongArch with LSX"
This reverts commit beb25b0430.

The bug was fixed in LLVM 22.
2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 67fa822300 test: disable switch on pointer type behavior test with LLVM
See: https://github.com/llvm/llvm-project/issues/176634

ref https://github.com/ziglang/zig/issues/23509
2026-04-25 21:54:48 +02:00
Alex Rønne Petersen 4c50c4b6e5 llvm: wire up the xtensa backend
As of LLVM 22, it can produce assembly and object files. No LLD support,
however, so using it is still a bit of a pain.
2026-04-25 21:54:47 +02:00
Alex Rønne Petersen 48d5b66677 std.Target: fuchsia supports arm/thumb now 2026-04-25 21:49:38 +02:00
Jacob Young 2040f9bfd0 x86_64: fix c abi of f32 struct field followed by padding
Closes #31864
2026-04-25 12:10:35 -04:00
Jacob Young cb1c7319b5 llvm: fix aarch64 c abi HFA detection
Aggregate types do not count as Homogeneous Aggregates if they have
padding gaps between fields or at the end due to field alignments.
2026-04-25 12:01:14 -04: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