| author | |
| committer | |
| log | 78dbc6fab87fe6bd55525d13195c41559a60129f |
| tree | 4068af8fae1c0096e23fe9ed6ff75df00bb670a6 |
| parent | d7061f33786b5f7fa15cb73359100c1fc485646e |
| signature | Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM |
4 files changed, 8 insertions(+), 30 deletions(-)
test/behavior/while.zig+8| ... | @@ -419,3 +419,11 @@ test "labeled break from else" { | ... | @@ -419,3 +419,11 @@ test "labeled break from else" { |
| 419 | try S.doTheTest(5); | 419 | try S.doTheTest(5); |
| 420 | try comptime S.doTheTest(5); | 420 | try comptime S.doTheTest(5); |
| 421 | } | 421 | } |
| 422 | |||
| 423 | fn infiniteLoop() noreturn { | ||
| 424 | while (true) {} | ||
| 425 | } | ||
| 426 | |||
| 427 | test "infinite while true" { | ||
| 428 | _ = &infiniteLoop; | ||
| 429 | } |
test/standalone/build.zig.zon-3| ... | @@ -135,9 +135,6 @@ | ... | @@ -135,9 +135,6 @@ |
| 135 | .issue_12706 = .{ | 135 | .issue_12706 = .{ |
| 136 | .path = "issue_12706", | 136 | .path = "issue_12706", |
| 137 | }, | 137 | }, |
| 138 | .strip_empty_loop = .{ | ||
| 139 | .path = "strip_empty_loop", | ||
| 140 | }, | ||
| 141 | .strip_struct_init = .{ | 138 | .strip_struct_init = .{ |
| 142 | .path = "strip_struct_init", | 139 | .path = "strip_struct_init", |
| 143 | }, | 140 | }, |
test/standalone/strip_empty_loop/build.zig deleted-24| ... | @@ -1,24 +0,0 @@ | ||
| 1 | const std = @import("std"); | ||
| 2 | |||
| 3 | pub fn build(b: *std.Build) void { | ||
| 4 | const test_step = b.step("test", "Test the program"); | ||
| 5 | b.default_step = test_step; | ||
| 6 | |||
| 7 | const optimize = std.builtin.Optimize.debug; | ||
| 8 | const target = b.graph.host; | ||
| 9 | |||
| 10 | const main = b.addExecutable(.{ | ||
| 11 | .name = "main", | ||
| 12 | .root_module = b.createModule(.{ | ||
| 13 | .root_source_file = b.path("main.zig"), | ||
| 14 | .optimize = optimize, | ||
| 15 | .target = target, | ||
| 16 | .strip = true, | ||
| 17 | }), | ||
| 18 | }); | ||
| 19 | |||
| 20 | // TODO: actually check the output | ||
| 21 | _ = main.getEmittedBin(); | ||
| 22 | |||
| 23 | test_step.dependOn(&main.step); | ||
| 24 | } | ||
test/standalone/strip_empty_loop/main.zig deleted-3| ... | @@ -1,3 +0,0 @@ | ||
| 1 | pub fn main() noreturn { | ||
| 2 | while (true) {} // When built without debug info, this produces an Air loop with no instructions | ||
| 3 | } | ||