aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/union.zig
AgeCommit message (Collapse)Author
2025-10-30aarch64: implement optional comparisonsJacob Young
2025-09-20Revert "frontend: another packedStructFieldPtrInfo fix"mlugg
This reverts commit dedccecda944f88a5278c12c24ffbea46126de63.
2025-09-20disable failing stage2_aarch64 behavior testsAndrew Kelley
2025-09-20frontend: another packedStructFieldPtrInfo fixAndrew Kelley
it was calculating host integer size in a wrong way. just use integer abi size
2025-09-20aarch64: enable fixed behaviorJacob Young
2025-09-17fix handling of comptime-only union fields in `Type.getUnionLayout` (#25182)Silver
Fixes #25180
2025-09-07behavior tests: remove one dependency on std libAndrew Kelley
2025-09-05behavior tests: update for new requirementAndrew Kelley
packed union fields must all have matching bit sizes
2025-08-09test: skip tests that were not meant to pass for spirvAli Cheraghi
2025-08-06Sema: fix initializing comptime-known constant with OPV union fieldmlugg
Resolves: #24716
2025-07-28aarch64: workaround some optional/union issuesJacob Young
2025-07-26aarch64: implement more optional/error union/union supportJacob Young
2025-07-22aarch64: add new from scratch self-hosted backendJacob Young
2025-06-28riscv64: skip failing testsBingwu Zhang
2025-06-19x86_64: increase passing test coverage on windowsJacob Young
Now that codegen has no references to linker state this is much easier. Closes #24153
2025-06-16rename spirv backend nameAli Cheraghi
`stage2_spirv64` -> `stage2_spirv`
2025-06-03Legalize: handle packed semanticsJacob Young
Closes #22915
2025-05-31Legalize: implement scalarization of binary operationsJacob Young
2025-05-28x86_64: implement integer `@reduce(.Add)`Jacob Young
2025-03-18spirv: aligned load for physical storage variablesAli Cheraghi
Resolves #23212
2025-02-24test: skip failing tests with spirv-vulkanAli Cheraghi
2025-02-06behavior: add test for old bugmlugg
Resolves: #2289
2025-01-18Sema: don't try to initialize global union pointer at comptimemlugg
Resolves: #19832
2025-01-16x86_64: implement union accessJacob Young
2025-01-16all: update to `std.builtin.Type.Pointer.Size` field renamesmlugg
This was done by regex substitution with `sed`. I then manually went over the entire diff and fixed any incorrect changes. This diff also changes a lot of `callconv(.C)` to `callconv(.c)`, since my regex happened to also trigger here. I opted to leave these changes in, since they *are* a correct migration, even if they're not the one I was trying to do!
2024-11-04test: Disable `reinterpret packed union` on all big endian targets.Alex Rønne Petersen
See: https://github.com/ziglang/zig/issues/21050
2024-10-31compiler: remove anonymous struct types, unify all tuplesmlugg
This commit reworks how anonymous struct literals and tuples work. Previously, an untyped anonymous struct literal (e.g. `const x = .{ .a = 123 }`) was given an "anonymous struct type", which is a special kind of struct which coerces using structural equivalence. This mechanism was a holdover from before we used RLS / result types as the primary mechanism of type inference. This commit changes the language so that the type assigned here is a "normal" struct type. It uses a form of equivalence based on the AST node and the type's structure, much like a reified (`@Type`) type. Additionally, tuples have been simplified. The distinction between "simple" and "complex" tuple types is eliminated. All tuples, even those explicitly declared using `struct { ... }` syntax, use structural equivalence, and do not undergo staged type resolution. Tuples are very restricted: they cannot have non-`auto` layouts, cannot have aligned fields, and cannot have default values with the exception of `comptime` fields. Tuples currently do not have optimized layout, but this can be changed in the future. This change simplifies the language, and fixes some problematic coercions through pointers which led to unintuitive behavior. Resolves: #16865
2024-10-18compiler: implement `@FieldType`mlugg
Resolves: #21702
2024-09-24std: add arch bits for s390x-linux (#21342)Meghan Denny
see #21402
2024-09-12riscv: implement `optional_payload_ptr_set`David Rubin
2024-09-05test: Disable `reinterpret packed union` for powerpc64 too.Alex Rønne Petersen
https://github.com/ziglang/zig/issues/21050
2024-08-29behavior: avoid field/decl name conflictsmlugg
2024-08-28std: update `std.builtin.Type` fields to follow naming conventionsmlugg
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
2024-08-12test: Disable `reinterpret packed union` on mips.Alex Rønne Petersen
https://github.com/ziglang/zig/issues/21050
2024-08-01std.Target: Rework isPPC()/isPPC64() functions.Alex Rønne Petersen
* Rename isPPC() -> isPowerPC32(). * Rename isPPC64() -> isPowerPC64(). * Add new isPowerPC() function which covers both. There was confusion even in the standard library about what isPPC() meant. This change makes these functions work how I think most people actually expect them to work, and makes them consistent with isMIPS(), isSPARC(), etc. I chose to rename from PPC to PowerPC because 1) it's more consistent with the other functions, and 2) it'll cause loud rather than silent breakage for anyone who might have been depending on isPPC() while misunderstanding it.
2024-07-26riscv: update tests and fix reuse bugDavid Rubin
2024-07-26riscv: airAsm rewriteDavid Rubin
with this rewrite we can call functions inside of inline assembly, enabling us to use the default start.zig logic all that's left is to implement lr/sc loops for atomically manipulating 1 and 2 byte values, after which we can use the segfault handler logic.
2024-07-26riscv: enable passing testsDavid Rubin
2024-07-26riscv: fix logic bug in `ptr_elem_ptr`David Rubin
I was doing duplicate work with `elemOffset` multiplying by the abi size and then the `ptr_add` `genBinOp` also multiplying. This led to having writes happening in the wrong place.
2024-07-14riscv: truncate `airStructFieldVal` resultDavid Rubin
2024-06-13riscv: rewrite "binOp"David Rubin
Reorganize how the binOp and genBinOp functions work. I've spent quite a while here reading exactly through the spec and so many tests are enabled because of several critical issues the old design had. There are some regressions that will take a long time to figure out individually so I will ignore them for now, and pray they get fixed by themselves. When we're closer to 100% passing is when I will start diving into them one-by-one.
2024-06-13riscv: implement optional logicDavid Rubin
2024-06-13riscv: zero registers when using register-wide operationsDavid Rubin
what was happening is that instructions like `lb` were only affecting the lower bytes of the register and leaving the top dirty. this would lead to situtations were `cmp_eq` for example was using `xor`, which was failing because of the left-over stuff in the top of the register. with this commit, we now zero out or truncate depending on the context, to ensure instructions like xor will provide proper results.
2024-06-13riscv: `std.fmt.format` runningDavid Rubin
- implements `airSlice`, `airBitAnd`, `airBitOr`, `airShr`. - got a basic design going for the `airErrorName` but for some reason it simply returns empty bytes. will investigate further. - only generating `.got.zig` entries when not compiling an object or shared library - reduced the total amount of ops a mnemonic can have to 3, simplifying the logic
2024-06-13riscv: arbitrary sized arraysDavid Rubin
2024-06-10spirv: disable tests that fail on poclRobin Voetter
Besides the Intel OpenCL CPU runtime, we can now run the behavior tests using the Portable Computing Language. This implementation is open-source, so it will be easier for us to patch in updated versions of spirv-llvm-translator that have bug fixes etc.
2024-05-11riscv: update behaviour tests againDavid Rubin
2024-05-11riscv: finally fix bug + `airAggregateInit`David Rubin
i just hadn't realized that I placed the `riscv_start` branch in the non-simplified starts
2024-05-11riscv: math progressDavid Rubin
2024-05-11riscv: add stage2_riscv to test matrix and bypass failing testsDavid Rubin