aboutsummaryrefslogtreecommitdiff
path: root/test/cases
AgeCommit message (Collapse)Author
2025-10-23std.builtin: add CallingConvention.x86_64_x32Alex Rønne Petersen
This was forgotten during the refactoring of std.builtin.CallingConvention. It mirrors mips64_n32 for MIPS.
2025-10-16detect invalid `@bitCast` with arraysxdBronch
2025-10-08don't make OPV tuple fields `comptime`xdBronch
2025-10-07detect references to `comptime var` in default values and sentinelsxdBronch
2025-10-04test: remove some tests that are now covered well enough by test-stack-tracesAlex Rønne Petersen
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-09-30std: allow disabling stack tracingmlugg
This option disables both capturing and printing stack traces. The default is to disable if debug info is stripped.
2025-09-24delete all the translate-c testsAndrew Kelley
the ziglang/translate-c package has its own test suite, so these are redundant
2025-09-23forbid trivial local address returned from functions (#25333)Andrew Kelley
progress towards #25312
2025-09-22std.pie: fix register constraint in getDynamicSymbol() for s390x (#25327)Alex Rønne Petersen
If the compiler happens to pick `ret = r0`, then this will assemble to `ag r0, 0` which is obviously not what we want. Using `a` instead of `r` will ensure that we get an appropriate address register, i.e. `r1` through `r15`. Re-enable pie_linux for s390x-linux which was disabled in ed7ff0b693037078f451a7c6c1124611060f4892.
2025-09-20allow some test cases to regressAndrew Kelley
tracked by #24061 - these should be re-enabled once that is solved.
2025-09-20fix rebase errormlugg
2025-09-20cases: update for new errormlugg
The latest bugfix reverted this case to its old behavior (which is a reasonable behavior to have).
2025-09-20Revert "delete failing test case"mlugg
This reverts commit ba4d4602ab9bb0dc17fc0d57141d9324bdbb356d.
2025-09-20Sema: add missed logic to checkPtrAttributesAndrew Kelley
It wasn't checking bit pointer data.
2025-09-20delete failing test caseAndrew Kelley
Matthew can revert this commit when he's ready to tackle the assertion failure
2025-09-20add compile error coverage for dependency loopAndrew Kelley
2025-09-20Sema: fix source location of "declared here" noteAndrew Kelley
point at the var not at the init expression
2025-09-20compiler: require comptime vector indexesAndrew Kelley
2025-09-16test: pull tests in test/cases/llvm/ up to test/cases/Alex Rønne Petersen
There is nothing inherently LLVM-specific about any of these.
2025-09-16test: delete old stage1 compile_errors testsAlex Rønne Petersen
generic_function_returning_opaque_type.zig was salvaged as it's still worth having.
2025-09-16test: rename backend=stage2 to backend=selfhosted, and add backend=autoAlex Rønne Petersen
backend=auto (now the default if backend is omitted) means to let the compiler pick whatever backend it wants as the default. This is important for platforms where we don't yet have a self-hosted backend, such as loongarch64. Also purge a bunch of redundant target=native.
2025-09-15frontend: fix reference tracking through coerced function bodiesmlugg
This bug was manifesting for user as a nasty link error because they were calling their application's main entry point as a coerced function, which essentially broke reference tracking for the entire ZCU, causing exported symbols to silently not get exported. I've been a little unsure about how coerced functions should interact with the unit graph before, but the solution is actually really obvious now: they shouldn't! `Sema` is now responsible for unwrapping possibly-coerced functions *before* queuing analysis or marking unit references. This makes the reference graph optimal (there are no redundant edges representing coerced versions of the same function) and simplifies logic elsewhere at the expense of just a few lines in Sema.
2025-09-07add compile error test caseAndrew Kelley
2025-09-05add compile error test case for new errorAndrew Kelley
2025-08-15Zcu: don't tell linkers about exports if there are compile errorsmlugg
In the best case, this is redundant work, because we aren't actually going to emit a working binary this update. In the worst case, it causes bugs because the linker may not have *seen* the thing being exported due to the compile errors. Resolves: #24417
2025-08-15fix: print error set members in a consistent orderWill Lillis
Co-authored-by: Matthew Lugg <mlugg@mlugg.co.uk>
2025-08-13Merge pull request #24674 from Justus2308/undef-shift-bitwiseMatthew Lugg
Sema: Improve comptime arithmetic undef handling
2025-08-12add remaining undef value tests ; fix `@truncate` undef retval typeJustus Klausecker
2025-08-12add undef shift tests ; mirror `zirShl` logic for `@shlWithOverflow`Justus Klausecker
2025-08-12remove redundant test casesJustus Klausecker
2025-08-12address most commentsJustus Klausecker
2025-08-12make `>>` a compile error with any undef arg ; add a bunch of test casesJustus Klausecker
2025-08-12Sema: Improve comptime arithmetic undef handlingJustus Klausecker
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-07address commentsJustus Klausecker
2025-08-07Add support for both '_' and 'else' prongs at the same time in switch statementsJustus Klausecker
If both are used, 'else' handles named members and '_' handles unnamed members. In this case the 'else' prong will be unrolled to an explicit case containing all remaining named values.
2025-08-07Permit explicit tags with '_' switch prongJustus Klausecker
Mainly affects ZIR representation of switch_block[_ref] and special prong (detection) logic for switch. Adds a new SpecialProng tag 'absorbing_under' that allows specifying additional explicit tags in a '_' prong which are respected when checking that every value is handled during semantic analysis but are not transformed into AIR and instead 'absorbed' by the '_' branch.
2025-08-03zig fmt: apply new cast builtin orderJustus Klausecker
2025-08-02disallow alignment on packed union fieldsDavid Rubin
2025-08-01remove usages of `.alignment = 0`David Rubin
2025-08-01Sema: compile error on reifying align(0) struct fieldsDavid Rubin
2025-07-31Sema: remove incorrect `requireRuntimeBlock` callsJackson Wambolt
Part of #22353 Resolves: #24273 Co-Authored-By: Matthew Lugg <mlugg@mlugg.co.uk>
2025-07-31Merge pull request #24632 from mlugg/lossy-int-to-float-coercionMatthew Lugg
Sema: compile error on lossy int to float coercion
2025-07-31Sema: add note suggesting dropping try on non error-unionsmikastiv
2025-07-31Sema: disallow slicing many-item pointer with different sentineldweiller
This change prevents adding or changing the sentinel in the type of a many-item pointer via the slicing syntax `ptr[a.. :S]`.
2025-07-31Sema: compile error on lossy int to float coercionmlugg
Resolves: #21586
2025-07-30Sema: check min/max operand typesJackson Wambolt
2025-07-30Merge pull request #24278 from gooncreeper/atomic-fixesMatthew Lugg
atomic fixes and clarification
2025-07-30Sema: disallow tags on non-auto unions when reifying (#23488)Krzysztof Wolicki
2025-07-30Sema: catch error sets in atomic operationsKendall Condon
also fix the struct test
2025-07-26aarch64: implement some safety checksJacob Young
Closes #24553