| author | |
| committer | |
| log | 12ce6eb8f65e6de5920c713cf2767e4b8ba0f1d3 |
| tree | 1d8da259b78eddf706c7c3e0d0d3d1511c970c85 |
| parent | 90ace40e07de7bca2558da72e6d67cf660f86192 |
2 files changed, 8 insertions(+), 4 deletions(-)
src-self-hosted/zir_sema.zig+6-2| ... | ... | @@ -643,8 +643,12 @@ fn analyzeInstBreakVoid(mod: *Module, scope: *Scope, inst: *zir.Inst.BreakVoid) |
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | fn analyzeInstDbgStmt(mod: *Module, scope: *Scope, inst: *zir.Inst.NoOp) InnerError!*Inst { |
| 646 | const b = try mod.requireRuntimeBlock(scope, inst.base.src); | |
| 647 | return mod.addNoOp(b, inst.base.src, Type.initTag(.void), .dbg_stmt); | |
| 646 | if (scope.cast(Scope.Block)) |b| { | |
| 647 | if (!b.is_comptime) { | |
| 648 | return mod.addNoOp(b, inst.base.src, Type.initTag(.void), .dbg_stmt); | |
| 649 | } | |
| 650 | } | |
| 651 | return mod.constVoid(scope, inst.base.src); | |
| 648 | 652 | } |
| 649 | 653 | |
| 650 | 654 | fn analyzeInstDeclRefStr(mod: *Module, scope: *Scope, inst: *zir.Inst.DeclRefStr) InnerError!*Inst { |
test/stage2/test.zig+2-2| ... | ... | @@ -973,8 +973,8 @@ pub fn addCases(ctx: *TestContext) !void { |
| 973 | 973 | \\comptime { |
| 974 | 974 | \\ _ = foo; |
| 975 | 975 | \\} |
| 976 | \\extern var foo; | |
| 977 | , &[_][]const u8{":2:5: error: unable to resolve comptime value"}); | |
| 976 | \\extern var foo: i32; | |
| 977 | , &[_][]const u8{":2:9: error: unable to resolve comptime value"}); | |
| 978 | 978 | case.addError( |
| 979 | 979 | \\export fn entry() void { |
| 980 | 980 | \\ _ = foo; |