Commit 589e564f16
Changed files (9)
test
cases
compile_errors
stage1
obj
src
test/cases/compile_errors/stage1/obj/call_with_new_stack_on_unsupported_target.zig
@@ -1,11 +0,0 @@
-var buf: [10]u8 align(16) = undefined;
-export fn entry() void {
- @call(.{ .stack = &buf }, foo, .{});
-}
-fn foo() void {}
-
-// error
-// backend=stage1
-// target=wasm32-wasi-none
-//
-// 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
@@ -1,11 +0,0 @@
-fn f(_: fn (anytype) void) void {}
-fn g(_: anytype) void {}
-export fn entry() void {
- f(g);
-}
-
-// error
-// backend=stage1
-// target=native
-//
-// 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
@@ -1,25 +0,0 @@
-const FooType = opaque {};
-fn generic(comptime T: type) !T {
- return undefined;
-}
-export fn bar() void {
- _ = generic(FooType);
-}
-export fn bav() void {
- _ = generic(@TypeOf(null));
-}
-export fn baz() void {
- _ = generic(@TypeOf(undefined));
-}
-
-// error
-// backend=stage1
-// target=native
-//
-// tmp.zig:6:16: error: call to generic function with Opaque return type 'FooType' not allowed
-// tmp.zig:2:1: note: function declared here
-// tmp.zig:1:1: note: type declared here
-// tmp.zig:9:16: error: call to generic function with Null return type '@Type(.Null)' not allowed
-// tmp.zig:2:1: note: function declared here
-// tmp.zig:12:16: error: call to generic function with Undefined return type '@Type(.Undefined)' not allowed
-// tmp.zig:2:1: note: function declared here
test/cases/compile_errors/stage1/obj/generic_function_where_return_type_is_self-referenced.zig
@@ -1,13 +0,0 @@
-fn Foo(comptime T: type) Foo(T) {
- return struct { x: T };
-}
-export fn entry() void {
- const t = Foo(u32){ .x = 1 };
- _ = t;
-}
-
-// error
-// backend=stage1
-// target=native
-//
-// 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
@@ -1,14 +0,0 @@
-export fn foo() void {
- var bar: u32 = 3;
- asm volatile (""
- : [baz] "+r" (bar),
- :
- : ""
- );
-}
-
-// error
-// backend=stage1
-// target=native
-//
-// 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
@@ -1,12 +0,0 @@
-export fn entry() void {
- var sp = asm volatile ("mov %[foo], sp"
- : [bar] "=r" (-> usize),
- );
- _ = &sp;
-}
-
-// error
-// backend=stage1
-// target=x86_64-linux-gnu
-//
-// tmp.zig:2:14: error: could not find 'foo' in the inputs or outputs
test/cases/compile_errors/generic_function_returning_opaque_type.zig
@@ -0,0 +1,16 @@
+fn generic(comptime T: type) T {
+ return undefined;
+}
+const MyOpaque = opaque {};
+export fn foo() void {
+ _ = generic(MyOpaque);
+}
+export fn bar() void {
+ _ = generic(anyopaque);
+}
+
+// error
+//
+// :1:30: error: opaque return type 'tmp.MyOpaque' not allowed
+// :4:18: note: opaque declared here
+// :1:30: error: opaque return type 'anyopaque' not allowed
test/cases/README.md
@@ -84,6 +84,5 @@ path will be prepended as a prefix on the test case name.
Possible backends are:
* `auto`: the default; compiler picks the backend based on robustness.
- * `stage1`: equivalent to `-fstage1`.
* `selfhosted`: equivalent to passing `-fno-llvm -fno-lld`.
* `llvm`: equivalent to `-fllvm`.
test/src/Cases.zig
@@ -28,7 +28,6 @@ pub const DepModule = struct {
pub const Backend = enum {
/// Test does not care which backend is used; compiler gets to pick the default.
auto,
- stage1,
selfhosted,
llvm,
};
@@ -623,7 +622,6 @@ pub fn lowerToBuildSteps(
const would_use_llvm = @import("../tests.zig").wouldUseLlvm(
switch (case.backend) {
.auto => null,
- .stage1 => continue,
.selfhosted => false,
.llvm => true,
},
@@ -699,7 +697,6 @@ pub fn lowerToBuildSteps(
switch (case.backend) {
.auto => {},
- .stage1 => continue,
.selfhosted => {
artifact.use_llvm = false;
artifact.use_lld = false;