diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-08-20 17:19:26 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-08-20 17:19:26 -0700 |
| commit | 56ea04cb6d1b2b87e2a2dbde6de8279e035bec73 (patch) | |
| tree | 3eb984f5ee8a79026b751f31284563b5ef9368fb /test/stage2 | |
| parent | 7d6d4b1473e7c0c8bc6ee29a3e0ecd03e850e5ee (diff) | |
| download | zig-56ea04cb6d1b2b87e2a2dbde6de8279e035bec73.tar.gz zig-56ea04cb6d1b2b87e2a2dbde6de8279e035bec73.zip | |
stage2: don't test compile errors of ZIR
Diffstat (limited to 'test/stage2')
| -rw-r--r-- | test/stage2/compile_errors.zig | 64 | ||||
| -rw-r--r-- | test/stage2/test.zig | 1 |
2 files changed, 0 insertions, 65 deletions
diff --git a/test/stage2/compile_errors.zig b/test/stage2/compile_errors.zig deleted file mode 100644 index ce53884aca..0000000000 --- a/test/stage2/compile_errors.zig +++ /dev/null @@ -1,64 +0,0 @@ -const TestContext = @import("../../src-self-hosted/test.zig").TestContext; -const std = @import("std"); - -const ErrorMsg = @import("../../src-self-hosted/Module.zig").ErrorMsg; - -const linux_x64 = std.zig.CrossTarget{ - .cpu_arch = .x86_64, - .os_tag = .linux, -}; - -pub fn addCases(ctx: *TestContext) !void { - ctx.compileErrorZIR("call undefined local", linux_x64, - \\@noreturn = primitive(noreturn) - \\ - \\@start_fnty = fntype([], @noreturn, cc=Naked) - \\@start = fn(@start_fnty, { - \\ %0 = call(%test, []) - \\}) - // TODO: address inconsistency in this message and the one in the next test - , &[_][]const u8{":5:13: error: unrecognized identifier: %test"}); - - ctx.compileErrorZIR("call with non-existent target", linux_x64, - \\@noreturn = primitive(noreturn) - \\ - \\@start_fnty = fntype([], @noreturn, cc=Naked) - \\@start = fn(@start_fnty, { - \\ %0 = call(@notafunc, []) - \\}) - \\@0 = str("_start") - \\@1 = export(@0, "start") - , &[_][]const u8{":5:13: error: decl 'notafunc' not found"}); - - // TODO: this error should occur at the call site, not the fntype decl - ctx.compileErrorZIR("call naked function", linux_x64, - \\@noreturn = primitive(noreturn) - \\ - \\@start_fnty = fntype([], @noreturn, cc=Naked) - \\@s = fn(@start_fnty, {}) - \\@start = fn(@start_fnty, { - \\ %0 = call(@s, []) - \\}) - \\@0 = str("_start") - \\@1 = export(@0, "start") - , &[_][]const u8{":4:9: error: unable to call function with naked calling convention"}); - - ctx.incrementalFailureZIR("exported symbol collision", linux_x64, - \\@noreturn = primitive(noreturn) - \\ - \\@start_fnty = fntype([], @noreturn) - \\@start = fn(@start_fnty, {}) - \\ - \\@0 = str("_start") - \\@1 = export(@0, "start") - \\@2 = export(@0, "start") - , &[_][]const u8{":8:13: error: exported symbol collision: _start"}, - \\@noreturn = primitive(noreturn) - \\ - \\@start_fnty = fntype([], @noreturn) - \\@start = fn(@start_fnty, {}) - \\ - \\@0 = str("_start") - \\@1 = export(@0, "start") - ); -} diff --git a/test/stage2/test.zig b/test/stage2/test.zig index f5acc72f93..182bd116e0 100644 --- a/test/stage2/test.zig +++ b/test/stage2/test.zig @@ -1,7 +1,6 @@ const TestContext = @import("../../src-self-hosted/test.zig").TestContext; pub fn addCases(ctx: *TestContext) !void { - try @import("compile_errors.zig").addCases(ctx); try @import("compare_output.zig").addCases(ctx); try @import("zir.zig").addCases(ctx); try @import("cbe.zig").addCases(ctx); |
