#target=x86_64-linux-selfhosted
#target=x86_64-linux-cbe
#target=x86_64-windows-cbe
//#target=wasm32-wasi-selfhosted
#update=initial version
#file=main.zig
const std = @import("std");
pub fn main() !void {
    try std.fs.File.stdout().writeAll(@This().foo);
}
const foo = "good morning\n";
#expect_stdout="good morning\n"

#update=add new declaration
#file=main.zig
const std = @import("std");
pub fn main() !void {
    try std.fs.File.stdout().writeAll(@This().foo);
}
const foo = "good morning\n";
const bar = "good evening\n";
#expect_stdout="good morning\n"

#update=reference new declaration
#file=main.zig
const std = @import("std");
pub fn main() !void {
    try std.fs.File.stdout().writeAll(@This().bar);
}
const foo = "good morning\n";
const bar = "good evening\n";
#expect_stdout="good evening\n"

#update=reference missing declaration
#file=main.zig
const std = @import("std");
pub fn main() !void {
    try std.fs.File.stdout().writeAll(@This().qux);
}
const foo = "good morning\n";
const bar = "good evening\n";
#expect_error=main.zig:3:46: error: root source file struct 'main' has no member named 'qux'
#expect_error=main.zig:1:1: note: struct declared here

#update=add missing declaration
#file=main.zig
const std = @import("std");
pub fn main() !void {
    try std.fs.File.stdout().writeAll(@This().qux);
}
const foo = "good morning\n";
const bar = "good evening\n";
const qux = "good night\n";
#expect_stdout="good night\n"

#update=remove unused declarations
#file=main.zig
const std = @import("std");
pub fn main() !void {
    try std.fs.File.stdout().writeAll(@This().qux);
}
const qux = "good night\n";
#expect_stdout="good night\n"
