aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/array.zig
AgeCommit message (Collapse)Author
2023-06-13all: replace `comptime try` with `try comptime`Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-05-20spirv: more passing testsRobin Voetter
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-11fix incorrect use of mutable pointers to temporary valuesVeikka Tuominen
2023-04-28stage2: sparc64: Skip unimplemented testsKoakuma
2023-04-20Sema: allow ptr field access on pointer-to-arraymlugg
Also remove an incorrect piece of logic which allowed fetching the 'len' property on non-single-ptrs (e.g. many-ptrs) and add a corresponding compile error test case. Resolves: #4765
2023-04-13x86_64: fix some of the mass confusion about the meaning of `MCValue`Jacob Young
2023-03-25x86_64: implement atomic loopsJacob Young
2023-03-24x86_64: fix value tracking bugsJacob Young
2023-03-21CBE: implement aggregateInit() for array of array case.Xavier Bouchoux
fixes `error(compilation): clang failed with stderr: error: array type 'uint32_t[10]' (aka 'unsigned int[10]') is not assignable`
2023-03-15disable failing aarch64 backend behavior testsAndrew Kelley
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-02-18update existing behavior tests and std lib to new for loop semanticsAndrew Kelley
2022-12-31add tests for fixed stage1 bugsVeikka Tuominen
Closes #4144 Closes #4255 Closes #4372 Closes #4375 Closes #4380 Closes #4417 Closes #4423 Closes #4476 Closes #4528 Closes #4562 Closes #4572 Closes #4597 Closes #4639 Closes #4672 Closes #4782 Closes #4955 Closes #4984 Closes #4997 Closes #5010 Closes #5114 Closes #5166 Closes #5173 Closes #5276
2022-12-27add behavior test for comptime pointer castingAndrew Kelley
comptime `@ptrCast` a subset of an array, then write through it closes #2444
2022-12-24behavior: disable tests on failing backendsJacob Young
2022-12-24Sema: relax undefined checks for concatJacob Young
Closes #14037
2022-12-24Sema: support concat of tuple and arrayJacob Young
Closes #14041
2022-12-10stage2: sparc64: Skip unimplemented testsKoakuma
2022-12-06remove references to stage1 in behavior testsAndrew Kelley
Good riddance.
2022-11-04Sema: correct condition in validateArrayInitVeikka Tuominen
Closes #13425
2022-10-25cbe: implement global assemblyJacob Young
2022-10-25behavior: enable stage2_c tests that are currently passingJacob Young
Also fix C warnings triggered by these tests.
2022-10-05fix(text): hyphenation and other fixesr00ster91
2022-09-09stage2 ARM: implement basic array_elem_valjoachimschmidt557
2022-09-09stage2 ARM: implement struct_field_val for registersjoachimschmidt557
2022-07-14Sema: fix coerceResultPtrAndrew Kelley
It did not handle properly when the dummy operand was a comptime_int; it was crashing in coerce because comptime_int is supposed to be comptime-known. So when calling coerceResultPtr, we pass the actual operand, not a dummy operand, which means it will have the proper comptime value when necessary.
2022-06-25stage2 ARM: implement basic intCast and error union wrappingjoachimschmidt557
2022-06-24stage2: sparc64: Skip Sema-failing tests for nowKoakuma
2022-06-17Sema: handle sentinels in tupleToArrayVeikka Tuominen
2022-06-03Sema: fix initialization of array with comptime only elem typeVeikka Tuominen
2022-05-27stage2 AArch64: complete genTypedValuejoachimschmidt557
2022-04-22clean up behavior testsAndrew Kelley
Split big test into the two separate things it is testing. Add missing checks to the test which revealed the test is not actually passing yet for the C backend.
2022-04-22C backend: Fix array declarationsAnnika L
2022-03-24pass more behaviour testsJakub Konka
2022-03-23stage2: enable some passing array & vector testsWilliam Sengir
2022-03-23stage2: make zero-sized array not cause recursive type definitionWilliam Sengir
2022-03-19wasm: Enable passing testsLuuk de Gram
This enables the tests that now pass due to the changes to lower parent pointers are lowered, as well as the additional features to unions.
2022-03-18stage2 ARM: implement slice_elem_ptr, ptr_elem_ptrjoachimschmidt557
2022-03-17Merge pull request #11192 from joachimschmidt557/stage2-armJoachim Schmidt
stage2 ARM: misc improvements
2022-03-16CBE: better handling of sentineled slices/arraysDaniele Cocca
Adds the sentinel element to the type name to avoid ambiguous declarations, and outputs the sentinel element (if needed) even in what would otherwise be empty arrays.
2022-03-16stage2 ARM: genSetStack for stack_argument_offsetjoachimschmidt557
2022-03-13stage2 AArch64: enable mul for ints with <= 64 bitsjoachimschmidt557
2022-03-11Sema: fix resolution of inferred error setsAndrew Kelley
Introduce `Module.ensureFuncBodyAnalyzed` and corresponding `Sema` function. This mirrors `ensureDeclAnalyzed` except also waits until the function body has been semantically analyzed, meaning that inferred error sets will have been populated. Resolving error sets can now emit a "unable to resolve inferred error set" error instead of producing an incorrect error set type. Resolving error sets now calls `ensureFuncBodyAnalyzed`. Closes #11046. `coerceInMemoryAllowedErrorSets` now does a lot more work to avoid resolving an inferred error set if possible. Same with `wrapErrorUnionSet`. Inferred error set types no longer check the `func` field to determine if they are equal. That was incorrect because an inline or comptime function call produces a unique error set which has the same `*Module.Fn` value for this field. Instead we use the `*Module.Fn.InferredErrorSet` pointers to test equality of inferred error sets.
2022-03-11stage2: Array len field should be a usize not comptime_intMitchell Hashimoto
2022-03-09Sema: implement pointer to tuple to pointer to array coercionAndrew Kelley
This involved an LLVM backend fix for the aggregate_init instruction.
2022-03-08stage2 ARM: implement ptr_add, ptr_sub for all element sizesjoachimschmidt557
Also reduces slice_elem_val to ptr_add, simplifying the implementation
2022-03-05stage2 AArch64: add more slice supportjoachimschmidt557
* airSlice * airArrayToSlice * and initial support for airSlicePtr and co