aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/array_llvm.zig
AgeCommit message (Collapse)Author
2022-02-12organize behavior testsAndrew Kelley
moving towards disabling failing tests on an individual basis
2022-02-03Move passing behavior testsLuuk de Gram
Singular tests (such as in the bug ones) are moved to top level with exclusions for non-passing backends. The big behavior tests such as array_llvm and slice are moved to the inner scope with the C backend disabled. They all pass for the wasm backend now
2022-01-20stage2: implement tuplesAndrew Kelley
* AIR instruction vector_init gains the ability to init arrays and tuples in addition to vectors. This will probably also gain the ability to initialize structs and be renamed to `aggregate_init`. * AstGen prefers to use an `anon_array_init` ZIR instruction for local variables when the init expr is an array literal and there is no type.
2022-01-16behavior tests: move tests aroundAndrew Kelley
2022-01-15AstGen: emit `as` instructions for branching expressionsAndrew Kelley
There is a mechanism to avoid redundant `as` ZIR instructions which is to pass `ResultLoc.coerced_ty` instead of `ResultLoc.ty` when it is known by AstGen that Sema will do the coercion. This commit downgrades `coerced_ty` to `ty` when a result location passes through an expression that branches, such as `if`, `switch`, `while`, and `for`, causing the `as` ZIR instruction to be emitted. This ensures that the type of a result location will be applied to, e.g. a `comptime_int` on either side of a branch on a runtime condition.
2022-01-15Sema: populate the sentinel for comptime array initsAndrew Kelley
2022-01-15stage2: fix Decl garbage collection not marking enoughAndrew Kelley
It is the job of codegen backends to mark Decls that are referenced as alive so that the frontend does not sweep them with the garbage. This commit unifies the code between the backends with an added method on Decl. The implementation is more complete than before, switching on the Decl val tag and recursing into sub-values. As a result, two more array tests are passing.
2022-01-14Sema: fix array_init with runtime elementAndrew Kelley
Previously it emitted an invalid AIR encoding.
2022-01-13Sema: comptime loads and stores for `elem_ptr`Andrew Kelley
The index is checked against actual array lengths, and now handles coerced or casted pointers to single items.
2021-12-30CBE; implement airLoad and airStore for arrays (#10452)drew
Effectively a small continuation of #10152 This allows the for.zig behavior tests to pass. Unfortunately to fully test everything I had to move a lot of behavior tests from array.zig; most of them now pass (sorry @rainbowbismuth!) I'm also conflicted on how I store constants into arrays because it's kind of stupid; array's can't be re-initialized using the same syntax, so instead of initializing each element, a new array is made which is copied into the destination. This also required that renderValue can't emit string literals for byte arrays given that they need to always have an extra byte for the NULL terminator, meaning that strings are no longer grep-able in the output.