aboutsummaryrefslogtreecommitdiff
path: root/test/behavior
AgeCommit message (Collapse)Author
2023-03-21Value: implement reinterpreting enum field index as integerVeikka Tuominen
Closes #15019
2023-03-21Value: handle comparisons of runtime_valuesVeikka Tuominen
Closes #15004
2023-03-21llvm: fix lowering packed union initiated to zero-bit valueVeikka Tuominen
Closes #14980
2023-03-17Sema: make @returnAddress return 0 at comptimemlugg
See also #14938. Resolves: #14931
2023-03-17Sema: allow dereferencing ill-defined pointers to zero-bit types at comptimemlugg
It doesn't matter if a pointer to a zero-bit (i.e. OPV) type is undefined or runtime-known; we still know the result of the dereference at comptime. Code may use this, for instance, when allocating zero-bit types: `@as(*void, undefined)` is entirely reasonable to use at runtime, since we know the pointer will never be accessed, thus it should be valid at comptime too.
2023-03-15disable failing aarch64 backend behavior testsAndrew Kelley
2023-03-15x86_64: handle duplicate prong deathsJacob Young
2023-03-15behavior: enable passing behavior tests on stage2_x86_64Jacob Young
2023-03-14Sema: allow comptime mutation of multiple array elementsmlugg
Previously, if you had a pointer to multiple array elements and tried to write to it at comptime, it was incorrectly treated as a pointer to one specific array value, leading to an assertion down the line. If we try to mutate a value at an elem_ptr larger than the element type, we need to perform a modification to multiple array elements. This solution isn't ideal, since it will result in storePtrVal serializing the whole array, modifying the relevant parts, and storing it back. Ideally, it would only take the required elements. However, this change would have been more complex, and this is a fairly rare operation (nobody ever ran into the bug before after all), so it doesn't matter all that much.
2023-03-13Sema: avoid panic on callconv(.C) generic return typeIan Johnson
Fixes #14854
2023-03-09sema: fix result ptr coercion array -> vectorJohn Schmidt
Previously this worked for array to vector where the element type matched exactly (e.g `[4]u8` to `@Vector(4, u8)`) since that is performed with a simple `.bitcast` operation, but now it also works for types where the array is coercible to the vector type (e.g `[4]u8` to `@Vector(4, u16)`).
2023-03-09sema: add peer type resolution for vectorsJohn Schmidt
This is consistent with how coercion for vectors work. So now you can do this: ``` var a: @Vector(2, u16) = .{1, 2}; var b: @Vector(2, u8) = .{2, 1}; const c = @min(a, b); ``` where previously you had to cast explicitly: ``` var a: @Vector(2, u16) = .{1, 2}; var b: @Vector(2, u8) = .{2, 1}; var c: @Vector(2, u16) = b; const c = @min(a, c); ```
2023-03-07CBE: implement unsigned big int div and modJacob Young
2023-03-07compiler_rt: fix rare case in udivei4Jacob Young
Unsigned integers are never less than zero, and so zig helpfully deleted the entire case. :D Closes #14816
2023-03-05Merge pull request #14789 from jacobly0/ditypeAndrew Kelley
llvm: fix use after free with pointers to optional slices
2023-03-05AstGen: ensure certain builtin functions return voidr00ster91
Fixes #14779 Co-authored-by: Veikka Tuominen <git@vexu.eu>
2023-03-05behavior: disable failing testsJacob Young
2023-03-05behavior: fix comptime issue and disable failing testJacob Young
2023-03-05CBE: ensure uniqueness of more internal identifiersJacob Young
2023-03-05CBE: implement select and shuffleJacob Young
2023-03-05CBE: implement splatJacob Young
2023-03-05CBE: implement vector truncateJacob Young
2023-03-05CBE: implement vector element pointersJacob Young
2023-03-05CBE: implement vector operationsJacob Young
Also, bigint add and sub which is all I was actually trying to do.
2023-03-05CBE: implement some big integer and vector unary operationsJacob Young
2023-03-05CBE: implement big integer and vector comparisonsJacob Young
2023-03-05CBE: implement big integer literalsJacob Young
2023-03-04add behavior test case for previous commitAndrew Kelley
2023-03-04Merge pull request #14781 from ziglang/codegen-cleanupJakub Konka
codegen: move common logic for generating typed values from each native backend into codegen.zig
2023-03-04Ast: properly handle sentinel-terminated slices in tupler00ster91
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2023-03-03arm: skip unimplemented behavior test for @fieldParentPtrJakub Konka
2023-02-24CBE: reuse locals with the same `CType` instead of `Type`Jacob Young
Many `Type`s can correspond to the same `CType`, so this reduces the number of used locals by 27760 when compiling only-c. Also, disabled some tests that were only passing by accident and shouldn't really be considered working.
2023-02-23CBE: implement the futureJacob Young
Turns out f(...) will be supported one day.
2023-02-23CBE: implement c varargsJacob Young
Removed some backend test skip checks for things disabled in std.
2023-02-23CType: fix lowering of generic function pointerJacob Young
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-22Merge pull request #14691 from jacobly0/ctypeAndrew Kelley
2023-02-21CBE: fix windows test failuresJacob Young
2023-02-21behavior: enable passing CBE testsJacob Young
2023-02-21Sema: implement @fieldParentPtr for unionsIsaac Freund
2023-02-20Merge pull request #14685 from ziglang/bitcast-fixesJakub Konka
Bitcast fixes for self-hosted native backends
2023-02-20arm: alloc new mcv in bitcast if cannot reuse operandJakub Konka
2023-02-20x86: alloc new mcv in bitcast if cannot reuse operandJakub Konka
Implement missing pointees when ptr is in register.
2023-02-19add test coverage for fixed bug. closes #5518Andrew Kelley
2023-02-19add test coverage for fixed bug. closes #5516Andrew Kelley
2023-02-19add test coverage for fixed bug. closes #5508Andrew Kelley
2023-02-19add test coverage for fixed bug. closes #5497Andrew Kelley
2023-02-18Sema: add missing coercion when checking for loop lenAndrew Kelley
2023-02-18implement error for unbounded for loopsAndrew Kelley
2023-02-18omit safety checks for element access in for loopsAndrew Kelley
One of the main points of for loops is that you can safety check the length once, before entering the loop, and then safely assume that every element inside the loop is in bounds. In master branch, the safety checks are incorrectly intact even inside for loops. This commit fixes it. It's especially nice with multi-object loops because the number of elided checks is N * M where N is how many iterations and M is how many objects.