| author | |
| committer | |
| log | 6ece10f63d91cfa16d8388f8d696368537c1662e |
| tree | 15aace22978455db73c29736606165589a312ee3 |
| parent | e9da2783ce3c65d8e8e8533b7c70ec5a867f830a |
9 files changed, 29 insertions(+), 10 deletions(-)
test/link/bss/main.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ const std = @import("std"); |
| 4 | 4 | var buffer: [0x1000000]u64 = [1]u64{0} ** 0x1000000; |
| 5 | 5 | |
| 6 | 6 | pub fn main() anyerror!void { |
| 7 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 7 | var stdout_writer = std.Io.File.stdout().writerStreaming(std.Options.debug_io, &.{}); | |
| 8 | 8 | |
| 9 | 9 | buffer[0x10] = 1; |
| 10 | 10 |
test/link/elf.zig+2-2| ... | ... | @@ -1323,7 +1323,7 @@ fn testGcSectionsZig(b: *Build, opts: Options) *Step { |
| 1323 | 1323 | \\extern var live_var2: i32; |
| 1324 | 1324 | \\extern fn live_fn2() void; |
| 1325 | 1325 | \\pub fn main() void { |
| 1326 | \\ var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 1326 | \\ var stdout_writer = std.Io.File.stdout().writerStreaming(std.Options.debug_io, &.{}); | |
| 1327 | 1327 | \\ stdout_writer.interface.print("{d} {d}\n", .{ live_var1, live_var2 }) catch @panic("fail"); |
| 1328 | 1328 | \\ live_fn2(); |
| 1329 | 1329 | \\} |
| ... | ... | @@ -1365,7 +1365,7 @@ fn testGcSectionsZig(b: *Build, opts: Options) *Step { |
| 1365 | 1365 | \\extern var live_var2: i32; |
| 1366 | 1366 | \\extern fn live_fn2() void; |
| 1367 | 1367 | \\pub fn main() void { |
| 1368 | \\ var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 1368 | \\ var stdout_writer = std.Io.File.stdout().writerStreaming(std.Options.debug_io, &.{}); | |
| 1369 | 1369 | \\ stdout_writer.interface.print("{d} {d}\n", .{ live_var1, live_var2 }) catch @panic("fail"); |
| 1370 | 1370 | \\ live_fn2(); |
| 1371 | 1371 | \\} |
test/link/macho.zig+2-2| ... | ... | @@ -716,7 +716,7 @@ fn testHelloZig(b: *Build, opts: Options) *Step { |
| 716 | 716 | const exe = addExecutable(b, opts, .{ .name = "main", .zig_source_bytes = |
| 717 | 717 | \\const std = @import("std"); |
| 718 | 718 | \\pub fn main() void { |
| 719 | \\ std.Io.File.stdout().writeAll("Hello world!\n") catch @panic("fail"); | |
| 719 | \\ std.Io.File.stdout().writeStreamingAll(std.Options.debug_io, "Hello world!\n") catch @panic("fail"); | |
| 720 | 720 | \\} |
| 721 | 721 | }); |
| 722 | 722 | |
| ... | ... | @@ -2372,7 +2372,7 @@ fn testTlsZig(b: *Build, opts: Options) *Step { |
| 2372 | 2372 | \\threadlocal var x: i32 = 0; |
| 2373 | 2373 | \\threadlocal var y: i32 = -1; |
| 2374 | 2374 | \\pub fn main() void { |
| 2375 | \\ var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 2375 | \\ var stdout_writer = std.Io.File.stdout().writerStreaming(std.Options.debug_io, &.{}); | |
| 2376 | 2376 | \\ stdout_writer.interface.print("{d} {d}\n", .{x, y}) catch unreachable; |
| 2377 | 2377 | \\ x -= 1; |
| 2378 | 2378 | \\ y += 1; |
test/link/wasm/extern/main.zig+1-1| ... | ... | @@ -3,6 +3,6 @@ const std = @import("std"); |
| 3 | 3 | extern const foo: u32; |
| 4 | 4 | |
| 5 | 5 | pub fn main() void { |
| 6 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 6 | var stdout_writer = std.Io.File.stdout().writerStreaming(std.Options.debug_io, &.{}); | |
| 7 | 7 | stdout_writer.interface.print("Result: {d}", .{foo}) catch {}; |
| 8 | 8 | } |
test/standalone/simple/guess_number/main.zig+11-1| ... | ... | @@ -1,8 +1,18 @@ |
| 1 | 1 | const builtin = @import("builtin"); |
| 2 | 2 | const std = @import("std"); |
| 3 | 3 | |
| 4 | // See https://github.com/ziglang/zig/issues/24510 | |
| 5 | // for the plan to simplify this code. | |
| 4 | 6 | pub fn main() !void { |
| 5 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 7 | var debug_allocator: std.heap.DebugAllocator(.{}) = .init; | |
| 8 | defer _ = debug_allocator.deinit(); | |
| 9 | const gpa = debug_allocator.allocator(); | |
| 10 | ||
| 11 | var threaded: std.Io.Threaded = .init(gpa, .{}); | |
| 12 | defer threaded.deinit(); | |
| 13 | const io = threaded.io(); | |
| 14 | ||
| 15 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 6 | 16 | const out = &stdout_writer.interface; |
| 7 | 17 | const stdin: std.Io.File = .stdin(); |
| 8 | 18 |
test/standalone/simple/hello_world/hello.zig+2| ... | ... | @@ -1,5 +1,7 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | // See https://github.com/ziglang/zig/issues/24510 | |
| 4 | // for the plan to simplify this code. | |
| 3 | 5 | pub fn main() !void { |
| 4 | 6 | var debug_allocator: std.heap.DebugAllocator(.{}) = .init; |
| 5 | 7 | defer _ = debug_allocator.deinit(); |
test/standalone/windows_bat_args/echo-args.zig+3-1| ... | ... | @@ -5,7 +5,9 @@ pub fn main() !void { |
| 5 | 5 | defer arena_state.deinit(); |
| 6 | 6 | const arena = arena_state.allocator(); |
| 7 | 7 | |
| 8 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 8 | const io = std.Options.debug_io; | |
| 9 | ||
| 10 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 9 | 11 | const stdout = &stdout_writer.interface; |
| 10 | 12 | var args = try std.process.argsAlloc(arena); |
| 11 | 13 | for (args[1..], 1..) |arg, i| { |
test/standalone/windows_paths/relative.zig+5-1| ... | ... | @@ -10,10 +10,14 @@ pub fn main() !void { |
| 10 | 10 | |
| 11 | 11 | if (args.len < 3) return error.MissingArgs; |
| 12 | 12 | |
| 13 | var threaded: std.Io.Threaded = .init(allocator, .{}); | |
| 14 | defer threaded.deinit(); | |
| 15 | const io = threaded.io(); | |
| 16 | ||
| 13 | 17 | const relative = try std.fs.path.relative(allocator, args[1], args[2]); |
| 14 | 18 | defer allocator.free(relative); |
| 15 | 19 | |
| 16 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 20 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 17 | 21 | const stdout = &stdout_writer.interface; |
| 18 | 22 | try stdout.writeAll(relative); |
| 19 | 23 | } |
test/standalone/windows_spawn/hello.zig+2-1| ... | ... | @@ -1,7 +1,8 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | |
| 3 | 3 | pub fn main() !void { |
| 4 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 4 | const io = std.Options.debug_io; | |
| 5 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 5 | 6 | const stdout = &stdout_writer.interface; |
| 6 | 7 | try stdout.writeAll("hello from exe\n"); |
| 7 | 8 | } |