aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/basic.zig
AgeCommit message (Collapse)Author
2024-01-29llvm: revert bad array access optimizationVeikka Tuominen
Closes #18723
2024-01-15test/behavior: replace all 'comptime expect' with 'comptime assert'dweiller
2024-01-06categorize `behavior/bugs/<issueno>.zig` testsVeikka Tuominen
2023-11-24spirv: disable failing testsRobin Voetter
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 crashesJacob Young
2023-10-18spirv: switch on boolAli 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-15std.testing: disable expectEqualSlices printing for spirvRobin Voetter
2023-10-15spirv: aggregate_init for structsRobin Voetter
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 non-byte-sized signed integer comparisonXavier Bouchoux
2023-09-23spirv: enable passing testsRobin Voetter
2023-09-23spirv: generate module initializerRobin Voetter
2023-06-25std.cstr: deprecate namespaceEric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
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-13all: replace `comptime try` with `try comptime`Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-05-31enable passing behavior testsLuuk de Gram
2023-05-20spirv: more passing testsRobin Voetter
2023-05-20spirv: ptr_addRobin Voetter
Implements the ptr_add air tag for spirv. The implementation for slices is probably wrong, but there seems to be no test for this...
2023-05-20spirv: dont use OpIAddCarryRobin Voetter
This instruction is not really working well in the LLVM SPIRV translator, as it is not implemented. This commit also intruces the constructStruct helper function to initialize structs at runtime. This is ALSO buggy in the translator, and we must work around OpCompositeConstruct not working when some of the constituents are runtime-known only. Some other improvements are made: - improved variable() so that it is more useful and no longer requires the address space. It always puts values in the Function address space, and returns a pointer to the Generic address space - adds a boolToInt utility function
2023-05-20spirv: implement pointer comparison in for air cmpRobin Voetter
It turns out that the Khronos LLVM SPIRV translator does not support OpPtrEqual. Therefore, this instruction is emitted using a series of conversions. This commit breaks intToEnum, because enum was removed from the arithmetic type info. The enum should be converted to an int before this function is called.
2023-05-13Merge pull request #15643 from Vexu/fixesVeikka Tuominen
make `@call` compile errors match regular calls
2023-05-11setup spirv backend in behavior testsAli Chraghi
2023-05-11Sema: return const pointers from ref initsVeikka Tuominen
Closes #12189
2023-05-09fix `[x]u65529` and above overflowingr00ster91
``` $ cat overflow.zig test { var a: [1]u65535 = undefined; _ = a; } $ zig-out/bin/zig test overflow.zig thread 290266 panic: integer overflow zig/src/type.zig:3604:55: 0xada43d in intAbiAlignment (zig) std.math.ceilPowerOfTwoPromote(u16, (bits + 7) / 8), ^ zig/src/type.zig:3598:42: 0xadd4ea in intAbiSize (zig) const alignment = intAbiAlignment(bits, target); ^ zig/src/type.zig:3500:61: 0x92be91 in abiSizeAdvanced (zig) return AbiSizeAdvanced{ .scalar = intAbiSize(bits, target) }; ^ zig/src/type.zig:3385:62: 0x928933 in abiSizeAdvanced (zig) switch (try payload.elem_type.abiSizeAdvanced(target, strat)) { ^ zig/src/type.zig:3268:32: 0x92c012 in abiSize (zig) return (abiSizeAdvanced(ty, target, .eager) catch unreachable).scalar; ^ ``` This is only noticed in a debug build of zig and silently does the wrong thing and overflows in release builds. This happened to `[x]u65529` and above because of the ` + 7` on a `u16`.
2023-05-08Disallow named test decls with duplicate namesDominic
2023-05-03x86_64: fix feature confusionJacob Young
2023-05-01behavior: update affected tests for the x86_64 backendJacob Young
2023-04-28llvm backend: fix lowering of memsetAndrew Kelley
The bitcast of ABI size 1 elements was problematic for some types.
2023-04-26behavior: update passing cbe testsJacob Young
2023-04-26Merge pull request #15278 from ziglang/memcpy-memsetAndrew Kelley
change semantics of `@memcpy` and `@memset`
2023-04-25x86_64 backend: support `@memset` with slicesAndrew Kelley
2023-04-25x86_64 backend: implement `@memset` for element ABI size > 1Andrew Kelley
* make memset and memset_safe guarantee that if the length is comptime-known then it will be nonzero.
2023-04-25add behavior test for `@memset` on slicesAndrew Kelley
and avoid new language feature in std.ArrayList for now, until x86_64 self-hosted backend can implement it.
2023-04-25Sema: implement comptime `@memcpy`Andrew Kelley
2023-04-25Sema: implement comptime `@memset`Andrew Kelley
2023-04-25LLVM backend: support non-byte-sized memsetAndrew Kelley
Also introduce memset_safe AIR tag and support it in C backend and LLVM backend.
2023-04-25change semantics of `@memcpy` and `@memset`Andrew Kelley
Now they use slices or array pointers with any element type instead of requiring byte pointers. This is a breaking enhancement to the language. The safety check for overlapping pointers will be implemented in a future commit. closes #14040
2023-04-25cbe: fix mutability issues with builtin test_functionsJacob Young
2023-04-02x86_64: implement large cmpJacob Young
2023-02-20Merge pull request #14685 from ziglang/bitcast-fixesJakub Konka
Bitcast fixes for self-hosted native backends
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-02AstGen: fix orelse type coercion in call argumentsVeikka Tuominen
Closes #14506
2023-01-29std: restrict mem.span() and mem.len() to sentinel terminated pointersIsaac Freund
These functions are currently footgunny when working with pointers to arrays and slices. They just return the stated length of the array/slice without iterating and looking for the first sentinel, even if the array/slice is a sentinel terminated type. From looking at the quite small list of places in the standard library/compiler that this change breaks existing code, the new code looks to be more readable in all cases. The usage of std.mem.span/len was totally unneeded in most of the cases affected by this breaking change. We could remove these functions entirely in favor of other existing functions in std.mem such as std.mem.sliceTo(), but that would be a somewhat nasty breaking change as std.mem.span() is very widely used for converting sentinel terminated pointers to slices. It is however not at all widely used for anything else. Therefore I think it is better to break these few non-standard and potentially incorrect usages of these functions now and at some later time, if deemed worthwhile, finally remove these functions. If we wait for at least a full release cycle so that everyone adapts to this change first, updating for the removal could be a simple find and replace without needing to worry about the semantics.
2023-01-03stage2 AArch64: bump up alignment of stack items fitting in regsjoachimschmidt557
This enables us to use more efficient loading and storing for these small stack items
2023-01-02skip "truncate to non-power-of-two integers from 128-bit" on non-llvmkcbanner