diff --git a/test/behavior/while.zig b/test/behavior/while.zig index f08c045c831cdb2b2cecd99c6b968c2b869b8cf1..695d67f02045da638eafc71d7a651d68be17538a 100644 --- a/test/behavior/while.zig +++ b/test/behavior/while.zig @@ -419,3 +419,11 @@ test "labeled break from else" { try S.doTheTest(5); try comptime S.doTheTest(5); } + +fn infiniteLoop() noreturn { + while (true) {} +} + +test "infinite while true" { + _ = &infiniteLoop; +} diff --git a/test/standalone/build.zig.zon b/test/standalone/build.zig.zon index 895af508f35ee03916312dc6099d9c8c3e301641..f0f7f6175be9106127036332c31e75e0e902e6fe 100644 --- a/test/standalone/build.zig.zon +++ b/test/standalone/build.zig.zon @@ -135,9 +135,6 @@ .issue_12706 = .{ .path = "issue_12706", }, - .strip_empty_loop = .{ - .path = "strip_empty_loop", - }, .strip_struct_init = .{ .path = "strip_struct_init", }, diff --git a/test/standalone/strip_empty_loop/build.zig b/test/standalone/strip_empty_loop/build.zig deleted file mode 100644 index 1e14c641f09d469c3f6cbd52ab679d940e8de468..0000000000000000000000000000000000000000 --- a/test/standalone/strip_empty_loop/build.zig +++ /dev/null @@ -1,24 +0,0 @@ -const std = @import("std"); - -pub fn build(b: *std.Build) void { - const test_step = b.step("test", "Test the program"); - b.default_step = test_step; - - const optimize = std.builtin.Optimize.debug; - const target = b.graph.host; - - const main = b.addExecutable(.{ - .name = "main", - .root_module = b.createModule(.{ - .root_source_file = b.path("main.zig"), - .optimize = optimize, - .target = target, - .strip = true, - }), - }); - - // TODO: actually check the output - _ = main.getEmittedBin(); - - test_step.dependOn(&main.step); -} diff --git a/test/standalone/strip_empty_loop/main.zig b/test/standalone/strip_empty_loop/main.zig deleted file mode 100644 index bfcb5ac94b34ced62025854026422057044003ee..0000000000000000000000000000000000000000 --- a/test/standalone/strip_empty_loop/main.zig +++ /dev/null @@ -1,3 +0,0 @@ -pub fn main() noreturn { - while (true) {} // When built without debug info, this produces an Air loop with no instructions -}