aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/struct.zig
AgeCommit message (Collapse)Author
2025-09-20add behavior test: avoid unused field function body compile errorAndrew Kelley
2025-09-20disable failing stage2_aarch64 behavior testsAndrew Kelley
2025-09-20aarch64: enable fixed behaviorJacob Young
2025-08-29LLVM backend:fix align 1 sret parameter load returnedAndrew Kelley
closes #25067
2025-08-11std.ArrayList: make unmanaged the defaultAndrew Kelley
2025-08-09test: skip tests that were not meant to pass for spirvAli Cheraghi
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-07-07remove `usingnamespace` from the languageAndrew Kelley
closes #20663
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-28x86_64: implement integer `@reduce(.Add)`Jacob Young
2025-04-28test: skip "struct fields get automatically reordered" for spirv64 backendAli Cheraghi
2025-04-11Merge pull request #23061 from pavelverigo/stage2-wasm-miscAndrew Kelley
stage2-wasm: multiple fixes
2025-04-05x86_64: fix incorrect handling of unreusable operandsJacob Young
Closes #23448
2025-03-24stage2-wasm: packed store/load 128 bitsPavel Verigo
2025-03-18spirv: packed struct init + field val accessAli Cheraghi
2025-02-24test: skip failing tests with spirv-vulkanAli Cheraghi
2025-01-16x86_64: implement switch jump tablesJacob 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!
2025-01-09Sema: rewrite semantic analysis of function callsmlugg
This rewrite improves some error messages, hugely simplifies the logic, and fixes several bugs. One of these bugs is technically a new rule which Andrew and I agreed on: if a parameter has a comptime-only type but is not declared `comptime`, then the corresponding call argument should not be *evaluated* at comptime; only resolved. Implementing this required changing how function types work a little, which in turn required allowing a new kind of function coercion for some generic use cases: function coercions are now allowed to implicitly *remove* `comptime` annotations from parameters with comptime-only types. This is okay because removing the annotation affects only the call site. Resolves: #22262
2024-11-03std.Target: Replace isARM() with isArmOrThumb() and rename it to isArm().Alex Rønne Petersen
The old isARM() function was a portability trap. With the name it had, it seemed like the obviously correct function to use, but it didn't include Thumb. In the vast majority of cases where someone wants to ask "is the target Arm?", Thumb *should* be included. There are exactly 3 cases in the codebase where we do actually need to exclude Thumb, although one of those is in Aro and mirrors a check in Clang that is itself likely a bug. These rare cases can just add an extra isThumb() check.
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-12riscv: implement `optional_payload_ptr_set`David Rubin
2024-09-01riscv: implement `errunion_payload_ptr_set`David Rubin
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-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: update testsDavid Rubin
2024-07-26riscv: implement sub-byte additionDavid Rubin
2024-07-26riscv: remove redundant assert in `genBinOp`David Rubin
2024-07-26riscv: implement more operatorsDavid Rubin
we can run `std.debug.print` now, with both run-time strings and integers!
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: add `airAggregateInit` for arraysDavid 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: by-value structs + `@min`David Rubin
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