| author | |
| committer | |
| log | 9f59189c954298fd2be576b7e3dd26388d07751d |
| tree | ff21bd4c7d054562c2823a306c8c9269b7c51289 |
| parent | 7a92b89a9d19f3e6d258c848f1be13a6e31fec97 |
4 files changed, 13 insertions(+), 24 deletions(-)
lib/std/Progress.zig+1-6| ... | ... | @@ -269,12 +269,7 @@ fn refreshWithHeldLock(self: *Progress) void { |
| 269 | 269 | } |
| 270 | 270 | if (eti > 0) { |
| 271 | 271 | if (need_ellipse) self.bufWrite(&end, " ", .{}); |
| 272 | if (builtin.zig_backend == .stage2_llvm) { | |
| 273 | self.bufWrite(&end, "[{d}/", .{current_item}); | |
| 274 | self.bufWrite(&end, "{d}] ", .{eti}); | |
| 275 | } else { | |
| 276 | self.bufWrite(&end, "[{d}/{d}] ", .{ current_item, eti }); | |
| 277 | } | |
| 272 | self.bufWrite(&end, "[{d}/{d}] ", .{ current_item, eti }); | |
| 278 | 273 | need_ellipse = false; |
| 279 | 274 | } else if (completed_items != 0) { |
| 280 | 275 | if (need_ellipse) self.bufWrite(&end, " ", .{}); |
lib/std/special/test_runner.zig+2-14| ... | ... | @@ -58,13 +58,7 @@ pub fn main() void { |
| 58 | 58 | test_node.activate(); |
| 59 | 59 | progress.refresh(); |
| 60 | 60 | if (!have_tty) { |
| 61 | if (builtin.zig_backend == .stage2_llvm) { | |
| 62 | std.debug.print("{d}/", .{i + 1}); | |
| 63 | std.debug.print("{d} ", .{test_fn_list.len}); | |
| 64 | std.debug.print("{s}... ", .{test_fn.name}); | |
| 65 | } else { | |
| 66 | std.debug.print("{d}/{d} {s}... ", .{ i + 1, test_fn_list.len, test_fn.name }); | |
| 67 | } | |
| 61 | std.debug.print("{d}/{d} {s}... ", .{ i + 1, test_fn_list.len, test_fn.name }); | |
| 68 | 62 | } |
| 69 | 63 | const result = if (test_fn.async_frame_size) |size| switch (io_mode) { |
| 70 | 64 | .evented => blk: { |
| ... | ... | @@ -109,13 +103,7 @@ pub fn main() void { |
| 109 | 103 | if (ok_count == test_fn_list.len) { |
| 110 | 104 | std.debug.print("All {d} tests passed.\n", .{ok_count}); |
| 111 | 105 | } else { |
| 112 | if (builtin.zig_backend == .stage2_llvm) { | |
| 113 | std.debug.print("{d} passed; ", .{ok_count}); | |
| 114 | std.debug.print("{d} skipped; ", .{skip_count}); | |
| 115 | std.debug.print("{d} failed.\n", .{fail_count}); | |
| 116 | } else { | |
| 117 | std.debug.print("{d} passed; {d} skipped; {d} failed.\n", .{ ok_count, skip_count, fail_count }); | |
| 118 | } | |
| 106 | std.debug.print("{d} passed; {d} skipped; {d} failed.\n", .{ ok_count, skip_count, fail_count }); | |
| 119 | 107 | } |
| 120 | 108 | if (log_err_count != 0) { |
| 121 | 109 | std.debug.print("{d} errors were logged.\n", .{log_err_count}); |
src/Sema.zig+8-2| ... | ... | @@ -4494,6 +4494,10 @@ fn analyzeCall( |
| 4494 | 4494 | |
| 4495 | 4495 | try sema.emitBackwardBranch(&child_block, call_src); |
| 4496 | 4496 | |
| 4497 | // Whether this call should be memoized, set to false if the call can mutate | |
| 4498 | // comptime state. | |
| 4499 | var should_memoize = true; | |
| 4500 | ||
| 4497 | 4501 | // This will have return instructions analyzed as break instructions to |
| 4498 | 4502 | // the block_inst above. Here we are performing "comptime/inline semantic analysis" |
| 4499 | 4503 | // for a function body, which means we must map the parameter ZIR instructions to |
| ... | ... | @@ -4527,6 +4531,7 @@ fn analyzeCall( |
| 4527 | 4531 | }, |
| 4528 | 4532 | else => {}, |
| 4529 | 4533 | } |
| 4534 | should_memoize = should_memoize and !arg_val.isComptimeMutablePtr(); | |
| 4530 | 4535 | memoized_call_key.args[arg_i] = .{ |
| 4531 | 4536 | .ty = param_ty, |
| 4532 | 4537 | .val = arg_val, |
| ... | ... | @@ -4552,6 +4557,7 @@ fn analyzeCall( |
| 4552 | 4557 | }, |
| 4553 | 4558 | else => {}, |
| 4554 | 4559 | } |
| 4560 | should_memoize = should_memoize and !arg_val.isComptimeMutablePtr(); | |
| 4555 | 4561 | memoized_call_key.args[arg_i] = .{ |
| 4556 | 4562 | .ty = sema.typeOf(uncasted_arg), |
| 4557 | 4563 | .val = arg_val, |
| ... | ... | @@ -4597,7 +4603,7 @@ fn analyzeCall( |
| 4597 | 4603 | // This `res2` is here instead of directly breaking from `res` due to a stage1 |
| 4598 | 4604 | // bug generating invalid LLVM IR. |
| 4599 | 4605 | const res2: Air.Inst.Ref = res2: { |
| 4600 | if (is_comptime_call) { | |
| 4606 | if (should_memoize and is_comptime_call) { | |
| 4601 | 4607 | if (mod.memoized_calls.get(memoized_call_key)) |result| { |
| 4602 | 4608 | const ty_inst = try sema.addType(fn_ret_ty); |
| 4603 | 4609 | try sema.air_values.append(gpa, result.val); |
| ... | ... | @@ -4621,7 +4627,7 @@ fn analyzeCall( |
| 4621 | 4627 | break :result try sema.analyzeBlockBody(block, call_src, &child_block, merges); |
| 4622 | 4628 | }; |
| 4623 | 4629 | |
| 4624 | if (is_comptime_call) { | |
| 4630 | if (should_memoize and is_comptime_call) { | |
| 4625 | 4631 | const result_val = try sema.resolveConstMaybeUndefVal(block, call_src, result); |
| 4626 | 4632 | |
| 4627 | 4633 | // TODO: check whether any external comptime memory was mutated by the |
test/behavior.zig+2-2| ... | ... | @@ -125,6 +125,7 @@ test { |
| 125 | 125 | _ = @import("behavior/widening.zig"); |
| 126 | 126 | _ = @import("behavior/bugs/421.zig"); |
| 127 | 127 | _ = @import("behavior/bugs/726.zig"); |
| 128 | _ = @import("behavior/bugs/828.zig"); | |
| 128 | 129 | _ = @import("behavior/bugs/1421.zig"); |
| 129 | 130 | _ = @import("behavior/bugs/1442.zig"); |
| 130 | 131 | _ = @import("behavior/bugs/1607.zig"); |
| ... | ... | @@ -132,6 +133,7 @@ test { |
| 132 | 133 | _ = @import("behavior/bugs/3384.zig"); |
| 133 | 134 | _ = @import("behavior/bugs/3742.zig"); |
| 134 | 135 | _ = @import("behavior/bugs/5398.zig"); |
| 136 | _ = @import("behavior/bugs/5413.zig"); | |
| 135 | 137 | _ = @import("behavior/bugs/5487.zig"); |
| 136 | 138 | _ = @import("behavior/struct_contains_null_ptr_itself.zig"); |
| 137 | 139 | _ = @import("behavior/switch_prong_err_enum.zig"); |
| ... | ... | @@ -148,12 +150,10 @@ test { |
| 148 | 150 | _ = @import("behavior/await_struct.zig"); |
| 149 | 151 | _ = @import("behavior/bugs/529.zig"); |
| 150 | 152 | _ = @import("behavior/bugs/718.zig"); |
| 151 | _ = @import("behavior/bugs/828.zig"); | |
| 152 | 153 | _ = @import("behavior/bugs/920.zig"); |
| 153 | 154 | _ = @import("behavior/bugs/1120.zig"); |
| 154 | 155 | _ = @import("behavior/bugs/1851.zig"); |
| 155 | 156 | _ = @import("behavior/bugs/3779.zig"); |
| 156 | _ = @import("behavior/bugs/5413.zig"); | |
| 157 | 157 | _ = @import("behavior/bugs/6456.zig"); |
| 158 | 158 | _ = @import("behavior/bugs/6781.zig"); |
| 159 | 159 | _ = @import("behavior/bugs/7003.zig"); |