zig/test
Andrew Kelley 70894d5c2f AstGen: fix loop result locations
The main problem was that the loop body was treated as an expression
that was one of the peer result values of a loop, when in reality the
loop body is noreturn and only the `break` operands are the result
values of loops.

This was solved by introducing an override that prevents rvalue() from
emitting a store to result location instruction for loop bodies.

An orthogonal change also included in this commit is switching
`elem_val` index expressions to using `coerced_ty` and doing the
coercion to `usize` inside `Sema`, resulting in smaller ZIR (since the
cast becomes implied).

I also changed the break operand expression to use `reachableExpr`,
introducing a new compile error for double break.

This makes a few more behavior tests pass for `while` and `for` loops.
2021-12-27 15:30:31 -07:00
..
behavior AstGen: fix loop result locations 2021-12-27 15:30:31 -07:00
src std lib API deprecations for the upcoming 0.9.0 release 2021-11-30 00:13:07 -07:00
stage1/c_abi stage1, stage2: rename c_void to anyopaque (#10316) 2021-12-19 00:24:45 -05:00
stage2 stage2 ARM: implement is_err and is_non_err for simple error unions 2021-12-21 23:13:30 +01:00
standalone add standalone tests for the new linker bug fixes 2021-12-15 10:31:29 +01:00
assemble_and_link.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
behavior.zig AstGen: fix loop result locations 2021-12-27 15:30:31 -07:00
cases.zig stage2: clean up tests 2021-12-15 17:28:48 +01:00
cli.zig Change ArgIterator.next() return type 2021-12-21 11:15:33 -08:00
compare_output.zig Change ArgIterator.next() return type 2021-12-21 11:15:33 -08:00
compile_errors.zig AstGen: fix loop result locations 2021-12-27 15:30:31 -07:00
gen_h.zig run zig fmt on src/ and test/ 2020-10-31 12:21:49 +02:00
run_translated_c.zig translate-c: coerce boolean results to c_int when negated 2021-11-20 19:52:06 -05:00
runtime_safety.zig fix unused variable errors in runtime safety test cases 2021-06-23 10:44:46 -07:00
stack_traces.zig overhaul elf csu (c-runtime startup) logic 2021-05-23 15:38:57 -04:00
standalone.zig update glibc start files to 2.34 2021-12-15 14:30:03 -07:00
tests.zig glibc: fix inconsistency of powerpc ABI mapping 2021-12-16 03:01:13 -07:00
translate_c.zig stage1, stage2: rename c_void to anyopaque (#10316) 2021-12-19 00:24:45 -05:00