authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-09-16 16:18:58+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-09-16 23:39:29+02:00
log589e564f16fd9c07dde9ae88910219d25b7a377f
tree137136134398468f288f100acda9193b5c2b285a
parent2e3fac3626a3edc61eb8afc7c17a19b5fec4b672
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

test: delete old stage1 compile_errors tests

generic_function_returning_opaque_type.zig was salvaged as it's still worth having.

9 files changed, 16 insertions(+), 90 deletions(-)

test/cases/README.md-1
......@@ -84,6 +84,5 @@ path will be prepended as a prefix on the test case name.
8484Possible backends are:
8585
8686 * `auto`: the default; compiler picks the backend based on robustness.
87 * `stage1`: equivalent to `-fstage1`.
8887 * `selfhosted`: equivalent to passing `-fno-llvm -fno-lld`.
8988 * `llvm`: equivalent to `-fllvm`.
test/cases/compile_errors/generic_function_returning_opaque_type.zig created+16
......@@ -0,0 +1,16 @@
1fn generic(comptime T: type) T {
2 return undefined;
3}
4const MyOpaque = opaque {};
5export fn foo() void {
6 _ = generic(MyOpaque);
7}
8export fn bar() void {
9 _ = generic(anyopaque);
10}
11
12// error
13//
14// :1:30: error: opaque return type 'tmp.MyOpaque' not allowed
15// :4:18: note: opaque declared here
16// :1:30: error: opaque return type 'anyopaque' not allowed
test/cases/compile_errors/stage1/obj/call_with_new_stack_on_unsupported_target.zig deleted-11
......@@ -1,11 +0,0 @@
1var buf: [10]u8 align(16) = undefined;
2export fn entry() void {
3 @call(.{ .stack = &buf }, foo, .{});
4}
5fn foo() void {}
6
7// error
8// backend=stage1
9// target=wasm32-wasi-none
10//
11// tmp.zig:3:5: error: target arch 'wasm32' does not support calling with a new stack
test/cases/compile_errors/stage1/obj/generic_fn_as_parameter_without_comptime_keyword.zig deleted-11
......@@ -1,11 +0,0 @@
1fn f(_: fn (anytype) void) void {}
2fn g(_: anytype) void {}
3export fn entry() void {
4 f(g);
5}
6
7// error
8// backend=stage1
9// target=native
10//
11// tmp.zig:1:9: error: parameter of type 'fn (anytype) anytype' must be declared comptime
test/cases/compile_errors/stage1/obj/generic_function_returning_opaque_type.zig deleted-25
......@@ -1,25 +0,0 @@
1const FooType = opaque {};
2fn generic(comptime T: type) !T {
3 return undefined;
4}
5export fn bar() void {
6 _ = generic(FooType);
7}
8export fn bav() void {
9 _ = generic(@TypeOf(null));
10}
11export fn baz() void {
12 _ = generic(@TypeOf(undefined));
13}
14
15// error
16// backend=stage1
17// target=native
18//
19// tmp.zig:6:16: error: call to generic function with Opaque return type 'FooType' not allowed
20// tmp.zig:2:1: note: function declared here
21// tmp.zig:1:1: note: type declared here
22// tmp.zig:9:16: error: call to generic function with Null return type '@Type(.Null)' not allowed
23// tmp.zig:2:1: note: function declared here
24// tmp.zig:12:16: error: call to generic function with Undefined return type '@Type(.Undefined)' not allowed
25// tmp.zig:2:1: note: function declared here
test/cases/compile_errors/stage1/obj/generic_function_where_return_type_is_self-referenced.zig deleted-13
......@@ -1,13 +0,0 @@
1fn Foo(comptime T: type) Foo(T) {
2 return struct { x: T };
3}
4export fn entry() void {
5 const t = Foo(u32){ .x = 1 };
6 _ = t;
7}
8
9// error
10// backend=stage1
11// target=native
12//
13// tmp.zig:1:29: error: evaluation exceeded 1000 backwards branches
test/cases/compile_errors/stage1/obj/unsupported_modifier_at_start_of_asm_output_constraint.zig deleted-14
......@@ -1,14 +0,0 @@
1export fn foo() void {
2 var bar: u32 = 3;
3 asm volatile (""
4 : [baz] "+r" (bar),
5 :
6 : ""
7 );
8}
9
10// error
11// backend=stage1
12// target=native
13//
14// tmp.zig:3:5: error: invalid modifier starting output constraint for 'baz': '+', only '=' is supported. Compiler TODO: see https://github.com/ziglang/zig/issues/215
test/cases/compile_errors/stage1/obj/variable_in_inline_assembly_template_cannot_be_found.zig deleted-12
......@@ -1,12 +0,0 @@
1export fn entry() void {
2 var sp = asm volatile ("mov %[foo], sp"
3 : [bar] "=r" (-> usize),
4 );
5 _ = &sp;
6}
7
8// error
9// backend=stage1
10// target=x86_64-linux-gnu
11//
12// tmp.zig:2:14: error: could not find 'foo' in the inputs or outputs
test/src/Cases.zig-3
......@@ -28,7 +28,6 @@ pub const DepModule = struct {
2828pub const Backend = enum {
2929 /// Test does not care which backend is used; compiler gets to pick the default.
3030 auto,
31 stage1,
3231 selfhosted,
3332 llvm,
3433};
......@@ -623,7 +622,6 @@ pub fn lowerToBuildSteps(
623622 const would_use_llvm = @import("../tests.zig").wouldUseLlvm(
624623 switch (case.backend) {
625624 .auto => null,
626 .stage1 => continue,
627625 .selfhosted => false,
628626 .llvm => true,
629627 },
......@@ -699,7 +697,6 @@ pub fn lowerToBuildSteps(
699697
700698 switch (case.backend) {
701699 .auto => {},
702 .stage1 => continue,
703700 .selfhosted => {
704701 artifact.use_llvm = false;
705702 artifact.use_lld = false;