| ... | ... | @@ -22,6 +22,9 @@ fn processArgs() void { |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | pub fn main() anyerror!void { |
| 25 | if (builtin.zig_is_stage2) { |
| 26 | return main2(); |
| 27 | } |
| 25 | 28 | processArgs(); |
| 26 | 29 | const test_fn_list = builtin.test_functions; |
| 27 | 30 | var ok_count: usize = 0; |
| ... | ... | @@ -123,3 +126,10 @@ pub fn log( |
| 123 | 126 | std.debug.print("[{s}] ({s}): " ++ format ++ "\n", .{ @tagName(scope), @tagName(message_level) } ++ args); |
| 124 | 127 | } |
| 125 | 128 | } |
| 129 | |
| 130 | pub fn main2() anyerror!void { |
| 131 | // Simpler main(), exercising fewer language features, so that stage2 can handle it. |
| 132 | for (builtin.test_functions) |test_fn| { |
| 133 | try test_fn.func(); |
| 134 | } |
| 135 | } |