1#exe {
2-Mroot=main.zig
3#}
4
5#write main.zig {
6const S = extern struct { x: u8, y: u8 };
7pub fn main() !void {
8 const val: S = .{ .x = 100, .y = 200 };
9 try foo(&val);
10}
11fn foo(val: *const S) !void {
12 var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{});
13 try stdout_writer.interface.print(
14 "{d} {d}\n",
15 .{ val.x, val.y },
16 );
17}
18const std = @import("std");
19const io = std.Io.Threaded.global_single_threaded.io();
20#}
21#update
22#check stdout {
23100 200
24#}
25
26#write main.zig {
27const S = extern struct { x: u32, y: u32 };
28pub fn main() !void {
29 const val: S = .{ .x = 100, .y = 200 };
30 try foo(&val);
31}
32fn foo(val: *const S) !void {
33 var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{});
34 try stdout_writer.interface.print(
35 "{d} {d}\n",
36 .{ val.x, val.y },
37 );
38}
39const std = @import("std");
40const io = std.Io.Threaded.global_single_threaded.io();
41#}
42#update "change struct layout"
43#check stdout {
44100 200
45#}
46
47#write main.zig {
48const S = extern struct { x: u32, y: u32 };
49pub fn main() !void {
50 const val: S = .{ .x = 1234, .y = 5678 };
51 try foo(&val);
52}
53fn foo(val: *const S) !void {
54 var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{});
55 try stdout_writer.interface.print(
56 "{d} {d}\n",
57 .{ val.x, val.y },
58 );
59}
60const std = @import("std");
61const io = std.Io.Threaded.global_single_threaded.io();
62#}
63#update "change values"
64#check stdout {
651234 5678
66#}