| ... | @@ -3,6 +3,18 @@ const builtin = @import("builtin"); | ... | @@ -3,6 +3,18 @@ const builtin = @import("builtin"); |
| 3 | const TestContext = @import("../src/test.zig").TestContext; | 3 | const TestContext = @import("../src/test.zig").TestContext; |
| 4 | | 4 | |
| 5 | pub fn addCases(ctx: *TestContext) !void { | 5 | pub fn addCases(ctx: *TestContext) !void { |
| | 6 | { |
| | 7 | var case = ctx.obj("stage2 compile errors", .{}); |
| | 8 | |
| | 9 | case.addError( |
| | 10 | \\export fn a() usize { |
| | 11 | \\ return @embedFile("/root/foo").len; |
| | 12 | \\} |
| | 13 | , &[_][]const u8{ |
| | 14 | ":2:12: error: embed of file outside package path: '/root/foo'", |
| | 15 | }); |
| | 16 | } |
| | 17 | |
| 6 | ctx.objErrStage1("issue #9346: return outside of function scope", | 18 | ctx.objErrStage1("issue #9346: return outside of function scope", |
| 7 | \\pub const empty = return 1; | 19 | \\pub const empty = return 1; |
| 8 | , &.{"tmp.zig:1:19: error: 'return' outside function scope"}); | 20 | , &.{"tmp.zig:1:19: error: 'return' outside function scope"}); |