From f0deef1d79db272fa80ef0323b4382ee1936a3e4 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 26 Nov 2021 23:17:01 -0700 Subject: Sema: fix analyzeBlockBody logic Previously, when a coercion needed to be inserted into a break instruction, the `br` AIR instruction would be rewritten so that the block operand was a sub-block that did the coercion. The problem is that the sub-block itself was never added to the parent block, resulting in the `br` instruction operand being a bad reference. Now, the `br` AIR instruction that needs to have coercion instructions added is replaced with the sub-block itself with type `noreturn`, and then the sub-block has the coercion instructions and a new `br` instruction that breaks from the original block. LLVM backend needed to be fixed to lower `noreturn` blocks without emitting an unused LLVM basic block. --- test/behavior.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/behavior.zig') diff --git a/test/behavior.zig b/test/behavior.zig index c6d090b28a..2da66e841b 100644 --- a/test/behavior.zig +++ b/test/behavior.zig @@ -24,25 +24,25 @@ test { _ = @import("behavior/defer.zig"); _ = @import("behavior/enum.zig"); _ = @import("behavior/error.zig"); + _ = @import("behavior/error.zig"); + _ = @import("behavior/generics.zig"); _ = @import("behavior/hasdecl.zig"); _ = @import("behavior/hasfield.zig"); _ = @import("behavior/if.zig"); _ = @import("behavior/int128.zig"); + _ = @import("behavior/member_func.zig"); _ = @import("behavior/null.zig"); + _ = @import("behavior/optional.zig"); _ = @import("behavior/pointers.zig"); _ = @import("behavior/ptrcast.zig"); _ = @import("behavior/pub_enum.zig"); _ = @import("behavior/struct.zig"); + _ = @import("behavior/this.zig"); + _ = @import("behavior/translate_c_macros.zig"); _ = @import("behavior/truncate.zig"); _ = @import("behavior/underscore.zig"); _ = @import("behavior/usingnamespace.zig"); _ = @import("behavior/while.zig"); - _ = @import("behavior/this.zig"); - _ = @import("behavior/member_func.zig"); - _ = @import("behavior/translate_c_macros.zig"); - _ = @import("behavior/generics.zig"); - _ = @import("behavior/error.zig"); - _ = @import("behavior/optional.zig"); if (builtin.object_format != .c) { // Tests that pass for stage1 and stage2 but not the C backend. -- cgit v1.2.3