aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/tuple.zig
AgeCommit message (Collapse)Author
2025-11-22all: replace all `@Type` usagesAli Cheraghi
Co-authored-by: Matthew Lugg <mlugg@mlugg.co.uk>
2025-11-04codegen: fix tuple paddingJacob Young
Closes #25797
2025-10-30aarch64: implement optional comparisonsJacob Young
2025-10-08don't make OPV tuple fields `comptime`xdBronch
2025-10-07don't make anonymous tuple fields referencing `comptime var`s `comptime`xdBronch
2025-09-20aarch64: enable fixed behaviorJacob Young
2025-08-01remove usages of `.alignment = 0`David Rubin
2025-07-22aarch64: add new from scratch self-hosted backendJacob Young
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-04-28Sema: fix alignment of runtime field pointer of underaligned tuplemlugg
2025-03-24stage2-wasm: clean memcpy + fix another bug in aggr_init for optionals arrPavel Verigo
2025-02-26test: remove dependencies on legacy coercionmlugg
2025-02-24test: skip failing tests with spirv-vulkanAli Cheraghi
2025-01-16all: update to `std.builtin.Type.{Pointer,Array,StructField}` field renamesmlugg
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-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-07-26riscv: update tests and fix reuse bugDavid Rubin
2024-07-26riscv: update testsDavid Rubin
2024-07-14riscv: truncate `airStructFieldVal` resultDavid Rubin
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-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
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.
2024-03-11std.builtin: make container layout fields lowercaseTristan Ross
2024-02-26Fix tuple default valuesJohn Schmidt
- Add default values to the list of comptime-known elements in `zirValidatePtrArrayInit` - In `structFieldValueComptime`, only assert `haveFieldInits` if we enter the`fieldIsComptime` branch (otherwise they are not needed).
2024-02-06x86_64+macho: pass more behavior testsJakub Konka
2024-02-04spirv: update testsRobin Voetter
2024-01-06categorize `behavior/bugs/<issueno>.zig` testsVeikka Tuominen
2024-01-03add missing resolveStructFieldInitsxdBronch
2023-11-19test: update behavior to silence 'var is never mutated' errorsmlugg
2023-10-22Revert "Revert "Merge pull request #17637 from jacobly0/x86_64-test-std""Jacob Young
This reverts commit 6f0198cadbe29294f2bf3153a27beebd64377566.
2023-10-22Revert "Merge pull request #17637 from jacobly0/x86_64-test-std"Andrew Kelley
This reverts commit 0c99ba1eab63865592bb084feb271cd4e4b0357e, reversing changes made to 5f92b070bf284f1493b1b5d433dd3adde2f46727. This caused a CI failure when it landed in master branch due to a 128-bit `@byteSwap` in std.mem.
2023-10-21x86_64: fix bugs and disable erroring testsJacob Young
2023-10-16spirv: fieldParentPtrAli Chraghi
2023-10-15spirv: update failing / passing testsRobin Voetter
Some tests are now failing due to debug info changes, some tests now pass due to improved compiler functionality.
2023-10-14tests: enable already passing behaviour tests for self-hosted wasmXavier Bouchoux
1611 passed; 262 skipped; 0 failed. (was: 1543 passed; 330 skipped; 0 failed.)
2023-10-14codegen/wasm: fix tuple member offset computationXavier Bouchoux
It didn't account for field alignement.
2023-10-03Add behavior test for empty tuple typeIan Johnson
Closes #16412
2023-09-23spirv: enable passing testsRobin Voetter
2023-07-28llvm: fix SysV C abi for structs smaller than two eightbytesJacob Young
Closes #16038 Closes #16288
2023-07-28Sema: don't reorder tuple fieldsJacob Young
This conflicts with anon structs which can be in-memory coercible but are never reordered. Closes #16242
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2023-06-14Sema: allow indexing tuple and vector pointersmlugg
Resolves: #13852 Resolves: #14705
2023-06-13all: replace `comptime try` with `try comptime`Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-05-15x86_64: implement union_initJacob Young
2023-05-11setup spirv backend in behavior testsAli Chraghi