zig/test
Justus Klausecker d0586da18e Sema: Improve comptime arithmetic undef handling
This commit expands on the foundations laid by https://github.com/ziglang/zig/pull/23177
and moves even more `Sema`-only functionality from `Value`
to `Sema.arith`. Specifically all shift and bitwise operations,
`@truncate`, `@bitReverse` and `@byteSwap` have been moved and
adapted to the new rules around `undefined`.

Especially the comptime shift operations have been basically
rewritten, fixing many open issues in the process.

New rules applied to operators:
* `<<`, `@shlExact`, `@shlWithOverflow`, `>>`, `@shrExact`: compile error if any operand is undef
* `<<|`, `~`, `^`, `@truncate`, `@bitReverse`, `@byteSwap`: return undef if any operand is undef
* `&`, `|`: Return undef if both operands are undef, turn undef into actual `0xAA` bytes otherwise

Additionally this commit canonicalizes the representation of
aggregates with all-undefined members in the `InternPool` by
disallowing them and enforcing the usage of a single typed
`undef` value instead. This reduces the amount of edge cases
and fixes a bunch of bugs related to partially undefined vecs.

List of operations directly affected by this patch:
* `<<`, `<<|`, `@shlExact`, `@shlWithOverflow`
* `>>`, `@shrExact`
* `&`, `|`, `~`, `^` and their atomic rmw + reduce pendants
* `@truncate`, `@bitReverse`, `@byteSwap`
2025-08-12 16:33:57 +02:00
..
behavior Sema: Improve comptime arithmetic undef handling 2025-08-12 16:33:57 +02:00
c_abi Remove numerous things deprecated during the 0.14 release cycle 2025-07-11 08:17:43 +02:00
c_import aarch64: add new from scratch self-hosted backend 2025-07-22 19:43:47 -07:00
cases Sema: Improve comptime arithmetic undef handling 2025-08-12 16:33:57 +02:00
incremental disable failing incremental test cases due to dwarf linker logic 2025-07-31 22:10:11 -07:00
link Migrate from deprecated Step.Compile APIs 2025-07-26 12:06:43 +02:00
src std.ArrayList: make unmanaged the default 2025-08-11 15:52:49 -07:00
standalone std.ArrayList: make unmanaged the default 2025-08-11 15:52:49 -07:00
assemble_and_link.zig
behavior.zig aarch64: add new from scratch self-hosted backend 2025-07-22 19:43:47 -07:00
c_import.zig
cases.zig
compare_output.zig update standalone and incremental tests to new API 2025-07-07 22:43:53 -07:00
compile_errors.zig compiler: refactor Zcu.File and path representation 2025-05-18 17:37:02 +01:00
gen_h.zig
llvm_ir.zig test: Add some basic LLVM IR tests for atomics, volatile, and allowzero. 2025-05-12 17:07:50 +02:00
llvm_targets.zig test: Remove x86-freebsd-none and powerpc-freebsd-eabihf from llvm_targets. 2025-05-29 16:48:28 +02:00
nvptx.zig Remove uses of deprecated callconv aliases 2025-03-05 03:01:43 +00:00
run_translated_c.zig
stack_traces.zig test: Disable error union switch with call operand (ReleaseSafe) on macos. 2025-04-04 06:08:10 +02:00
tests.zig Revert "Sema: Stop adding Windows implib link inputs for extern "..." syntax." 2025-08-06 06:15:13 +02:00
translate_c.zig zig fmt: apply new cast builtin order 2025-08-03 14:59:56 +02:00