| author | |
| committer | |
| log | bcc371618fd71185e71a889c09eb68733ca66842 |
| tree | 9fa3bff07baa61f3edadff24a3c5898418267472 |
| parent | 2871d32be727fc729ba4be0c615cb5fe97591391 |
Previously it relied on the breakpoint ZIR instruction being void, but
that's no longer how things work.2 files changed, 11 insertions(+), 2 deletions(-)
src/AstGen.zig+2-2| ... | ... | @@ -3894,11 +3894,11 @@ fn builtinCall( |
| 3894 | 3894 | return rvalue(gz, scope, rl, result, node); |
| 3895 | 3895 | }, |
| 3896 | 3896 | .breakpoint => { |
| 3897 | const result = try gz.add(.{ | |
| 3897 | _ = try gz.add(.{ | |
| 3898 | 3898 | .tag = .breakpoint, |
| 3899 | 3899 | .data = .{ .node = gz.astgen.decl.nodeIndexToRelative(node) }, |
| 3900 | 3900 | }); |
| 3901 | return rvalue(gz, scope, rl, result, node); | |
| 3901 | return rvalue(gz, scope, rl, .void_value, node); | |
| 3902 | 3902 | }, |
| 3903 | 3903 | .import => { |
| 3904 | 3904 | const target = try expr(gz, scope, .none, params[0]); |
test/stage2/cbe.zig+9| ... | ... | @@ -280,6 +280,15 @@ pub fn addCases(ctx: *TestContext) !void { |
| 280 | 280 | \\} |
| 281 | 281 | , ""); |
| 282 | 282 | |
| 283 | // If expression with breakpoint that does not get hit | |
| 284 | case.addCompareOutput( | |
| 285 | \\export fn main() c_int { | |
| 286 | \\ var x: i32 = 1; | |
| 287 | \\ if (x != 1) @breakpoint(); | |
| 288 | \\ return 0; | |
| 289 | \\} | |
| 290 | , ""); | |
| 291 | ||
| 283 | 292 | // Switch expression |
| 284 | 293 | case.addCompareOutput( |
| 285 | 294 | \\export fn main() c_int { |