aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/field_parent_ptr.zig
AgeCommit message (Collapse)Author
2025-09-20disable failing stage2_aarch64 behavior testsAndrew Kelley
2025-09-05disable failing behavior test on stage2_aarch64Andrew Kelley
2025-09-05behavior tests: update for new requirementAndrew Kelley
packed union fields must all have matching bit sizes
2025-07-29disable more failing testsmlugg
Wow, *lots* of backends were reliant on Sema doing the heavy lifting for them. CBE, Wasm, and SPIR-V have all regressed in places now that they actually need to, like, initialize unions and such.
2025-07-29Sema: remove redundant comptime-known initializer trackingmlugg
This logic predates certain Sema enhancements whose behavior it essentially tries to emulate in one specific case in a problematic way. In particular, this logic handled initializing comptime-known `const`s through RLS, which was reworked a few years back in 644041b to not rely on this logic, and catching runtime fields in comptime-only initializers, which has since been *correctly* fixed with better checks in `Sema.storePtr2`. That made the highly complex logic in `validateStructInit`, `validateUnionInit`, and `zirValidatePtrArrayInit` entirely redundant. Worse, it was also causing some tracked bugs, as well as a bug which I have identified and fixed in this PR (a corresponding behavior test is added). This commit simplifies union initialization by bringing the runtime logic more in line with the comptime logic: the tag is now always populated by `Sema.unionFieldPtr` based on `initializing`, where this previously happened only in the comptime case (with `validateUnionInit` instead handling it in the runtime case). Notably, this means that backends are now able to consider getting a pointer to an inactive union field as Illegal Behavior, because the `set_union_tag` instruction now appears *before* the `struct_field_ptr` instruction as you would probably expect it to. Resolves: #24520 Resolves: #24595
2025-07-26aarch64: implement more optional/error union/union supportJacob Young
2025-07-22aarch64: add new from scratch self-hosted backendJacob Young
2025-06-16rename spirv backend nameAli Cheraghi
`stage2_spirv64` -> `stage2_spirv`
2025-03-24stage2-wasm: pass field_parent_ptr testsPavel Verigo
Handle packed containers, also fixes packed union lowering for non int type + union field pointer logic fix
2025-02-24test: skip failing tests with spirv-vulkanAli Cheraghi
2024-05-11riscv: add stage2_riscv to test matrix and bypass failing testsDavid Rubin
2024-04-17test: disable newly failing testmlugg
I have noted several latent bugs in the handling of packed memory on big-endian targets, and one of them has been exposed by the previous commit, triggering this test failure. I am opting to disable it for now on the ground that the commit preceding this one helps far more than it hurts.
2024-04-05spirv: make behavior tests passingAli Chraghi
2024-03-30Update uses of `@fieldParentPtr` to use RLSJacob Young
2024-03-30Sema: rework `@fieldParentPtr` to accept a pointer typeJacob Young
There is no way to know the expected parent pointer attributes (most notably alignment) from the type of the field pointer, so provide them in the first argument.
2023-10-16spirv: fieldParentPtrAli Chraghi
2023-06-13all: replace `comptime try` with `try comptime`Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-05-15x86_64: fix field_ptr nonsenseJacob Young
2023-05-11setup spirv backend in behavior testsAli Chraghi
2023-05-08x86_64: fix unordered float equalityJacob Young
2023-03-03arm: skip unimplemented behavior test for @fieldParentPtrJakub Konka
2023-02-23CBE: cleanup field accessJacob Young
* Implement @fieldParentPtr on a union * Refactor field access to ensure that it is handled consistently * Remove `renderTypecast` as it is now behaves the same as `renderType`
2023-02-21Sema: implement @fieldParentPtr for unionsIsaac Freund
2022-12-27stage2 AArch64: implement field_parent_ptrjoachimschmidt557
2022-12-10stage2: sparc64: Skip unimplemented testsKoakuma
2022-10-25cbe: implement field_parent_ptrJacob Young
2022-09-09stage2 ARM: implement field_parent_ptrjoachimschmidt557
2022-03-09wasm: Enable passing behavior testsLuuk de Gram
This also adds some float-related instructions to MIR/Emit
2021-05-08Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
Conflicts: * doc/langref.html.in * lib/std/enums.zig * lib/std/fmt.zig * lib/std/hash/auto_hash.zig * lib/std/math.zig * lib/std/mem.zig * lib/std/meta.zig * test/behavior/alignof.zig * test/behavior/bitcast.zig * test/behavior/bugs/1421.zig * test/behavior/cast.zig * test/behavior/ptrcast.zig * test/behavior/type_info.zig * test/behavior/vector.zig Master branch added `try` to a bunch of testing function calls, and some lines also had changed how to refer to the native architecture and other `@import("builtin")` stuff.
2021-04-29move behavior tests from test/stage1/ to test/Andrew Kelley
And fix test cases to make them pass. This is in preparation for starting to pass behavior tests with self-hosted.