| 1 | #exe { |
| 2 | -Mroot=main.zig |
| 3 | #} |
| 4 | |
| 5 | #write main.zig { |
| 6 | pub fn main() !void { |
| 7 | try foo(false); |
| 8 | } |
| 9 | fn foo(recurse: bool) !void { |
| 10 | const stdout = std.Io.File.stdout(); |
| 11 | if (recurse) return foo(true); |
| 12 | try stdout.writeStreamingAll(io, "non-recursive path\n"); |
| 13 | } |
| 14 | const std = @import("std"); |
| 15 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 16 | #} |
| 17 | #update |
| 18 | #check stdout { |
| 19 | non-recursive path |
| 20 | #} |
| 21 | |
| 22 | #write main.zig { |
| 23 | pub fn main() !void { |
| 24 | try foo(true); |
| 25 | } |
| 26 | fn foo(recurse: bool) !void { |
| 27 | const stdout = std.Io.File.stdout(); |
| 28 | if (recurse) return stdout.writeStreamingAll(io, "x==1\n"); |
| 29 | try stdout.writeStreamingAll(io, "non-recursive path\n"); |
| 30 | } |
| 31 | const std = @import("std"); |
| 32 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 33 | #} |
| 34 | #update "eliminate recursion and change argument" |
| 35 | #check stdout { |
| 36 | x==1 |
| 37 | #} |