aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/slice.zig
AgeCommit message (Collapse)Author
2025-08-09test: skip tests that were not meant to pass for spirvAli Cheraghi
2025-08-02spirv: refactorAli Cheraghi
2025-07-31Sema: disallow slicing many-item pointer with different sentineldweiller
This change prevents adding or changing the sentinel in the type of a many-item pointer via the slicing syntax `ptr[a.. :S]`.
2025-07-28aarch64: workaround some optional/union issuesJacob Young
2025-07-22aarch64: add new from scratch self-hosted backendJacob Young
2025-06-23x86_64: fix pair live-out trackingJacob Young
Closes #24226
2025-06-16rename spirv backend nameAli Cheraghi
`stage2_spirv64` -> `stage2_spirv`
2025-05-28x86_64: implement integer `@reduce(.Add)`Jacob Young
2025-02-24test: skip failing tests with spirv-vulkanAli Cheraghi
2025-02-05compiler: provide result type to sentinel expression in slice operationmlugg
Resolves: #21867
2024-12-29fix slice of slice with sentinel on the lhs sliceTechatrix
example: ```zig test { var foo: [2:0]u8 = .{ 1, 2 }; _ = foo[0.. :1][0..2]; } ``` A `.slice_open` ast node will not have a end index nor sentinel.
2024-12-29fix slice of slice with sentinel but no end indexTechatrix
example: ```zig test { var foo = ""; _ = foo[0..][0.. :0]; } ``` A `.slice_sentinel` ast node may not have an end index.
2024-11-16Sema: fix peer resolution alignment between slice and empty structJacob Young
An empty struct that coerces to an empty array should not force `align(1)` on the resulting slice type.
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: 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-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: add `airAggregateInit` for arraysDavid Rubin
2024-06-13riscv: first sign of floats!David 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-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: 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-01-15test/behavior: fix test type check for multi-ptr slicedweiller
The original test was checking the types of irrelevant slices, the test is for slicing of multi-pointers _without_ an end value, but the types of slices with an end value were being checked.
2024-01-15test/behavior: replace all 'comptime expect' with 'comptime assert'dweiller
2024-01-14sema: allow slicing *T with comptime known [0..1]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-11-07sema: allow slicing [*]T without enddweiller
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-15spirv: handle zero-sized arraysRobin Voetter
2023-10-15spirv: cast result of .elem pointers to right type if neededRobin Voetter
2023-10-15spirv: constant elem ptr fixRobin Voetter
2023-09-23spirv: enable passing testsRobin Voetter
2023-09-23spirv: constant elem ptrRobin Voetter
2023-09-23spirv: air array_to_sliceRobin Voetter
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-19all: zig fmt and rename "@XToY" to "@YFromX"Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-15Sema: allow empty end index in zirSliceSentinelmlugg
This fixes a regression, and enables some related behavior tests which were accidentally disabled.
2023-06-15Sema: don't assume slice value is interned when loading from comptime pointermlugg
Resolves: #16030
2023-06-13all: replace `comptime try` with `try comptime`Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-05-20Merge pull request #15753 from Snektron/spirv-more-testsAndrew Kelley
spirv: make more tests pass
2023-05-20spirv: ptr_elem_valRobin Voetter
Implements the ptr_elem_val air tag. Implementation is unified with ptr_elem_ptr.
2023-05-20spirv: more passing testsRobin Voetter
2023-05-19wasm: correctly use elem type when loweringLuuk de Gram
Previously when lowering a value of `elem_ptr` we would multiply the abisize of the parent type by the index, rather than the element type. This would result in an invalid pointer way beyond the correct pointer. We now also pass the current offset to each recursive call to ensure we do not miss inner offsets.
2023-05-15spirv: lower float_to_int and int_to_floatAli Chraghi
2023-05-11setup spirv backend in behavior testsAli Chraghi