stage2: get formatted printing (somewhat) working

This commit is contained in:
Veikka Tuominen 2022-02-27 10:00:15 +02:00
parent 4d658f83ed
commit 593d23c0d7
2 changed files with 15 additions and 4 deletions

View File

@ -141,8 +141,20 @@ pub fn main2() anyerror!void {
}
};
}
if (builtin.zig_backend == .stage2_llvm or
builtin.zig_backend == .stage2_wasm or
if (builtin.zig_backend == .stage2_llvm) {
const stderr = std.io.getStdErr().writer();
const ok_count = builtin.test_functions.len - skipped - failed;
if (ok_count == builtin.test_functions.len) {
try stderr.print("All {d} tests passed.\n", .{ok_count});
} else {
try stderr.print("{d} passed; ", .{ok_count});
try stderr.print("{d} skipped; ", .{skipped});
try stderr.print("{d} failed.\n", .{failed});
}
if (failed != 0) {
std.process.exit(1);
}
} else if (builtin.zig_backend == .stage2_wasm or
builtin.zig_backend == .stage2_x86_64)
{
const passed = builtin.test_functions.len - skipped - failed;

View File

@ -10975,8 +10975,7 @@ fn zirCondbr(
if (try sema.resolveDefinedValue(parent_block, src, cond)) |cond_val| {
const body = if (cond_val.toBool()) then_body else else_body;
_ = try sema.analyzeBody(parent_block, body);
return always_noreturn;
return sema.analyzeBodyInner(parent_block, body);
}
const gpa = sema.gpa;