Commit 593d23c0d7

Veikka Tuominen <git@vexu.eu>
2022-02-27 09:00:15
stage2: get formatted printing (somewhat) working
1 parent 4d658f8
Changed files (2)
lib
std
src
lib/std/special/test_runner.zig
@@ -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;
src/Sema.zig
@@ -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;