aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 21c8822eb3..e0b78b3000 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -288,4 +288,26 @@ pub fn addCases(ctx: *TestContext) !void {
//, &[_][]const u8{
// "tmp.zig:4:1: error: unable to inline function",
//});
+
+ {
+ const case = ctx.obj("file in multiple modules", .{});
+ case.backend = .stage2;
+
+ case.addSourceFile("foo.zig",
+ \\const dummy = 0;
+ );
+
+ case.addDepModule("foo", "foo.zig");
+
+ case.addError(
+ \\comptime {
+ \\ _ = @import("foo");
+ \\ _ = @import("foo.zig");
+ \\}
+ , &[_][]const u8{
+ ":1:1: error: file exists in multiple modules",
+ ":1:1: note: root of module root.foo",
+ ":3:17: note: imported from module root",
+ });
+ }
}