commit 67e6df4313a982fa08ab6ec6de1da427aaf83409 (tree)
parent 69cf40da600224734d39c6f64fb2e0905e42d54a
Author: mlugg <mlugg@mlugg.co.uk>
Date: Fri, 18 Jul 2025 09:53:57 +0100
tests: remove more old async tests
The rejection of #6025 indicates that if stackless coroutines return to
Zig, they will look quite different; see #23446 for the working draft
proposal for their return (though it will definitely be tweaked before
being accepted). Some of this test coverage was deleted in 40d11cc, but
because stackless coroutines will take on a new form if re-introduced, I
anticipate that essentially *none* of this coverage will be relevant. Of
course, if it for some reason is, we can always grab it from the Git
history.
Diffstat:
11 files changed, 0 insertions(+), 158 deletions(-)
diff --git a/test/behavior/type_info.zig b/test/behavior/type_info.zig
@@ -539,20 +539,6 @@ fn add(a: i32, b: i32) i32 {
return a + b;
}
-test "type info for async frames" {
- if (true) {
- // https://github.com/ziglang/zig/issues/6025
- return error.SkipZigTest;
- }
-
- switch (@typeInfo(@Frame(add))) {
- .frame => |frame| {
- try expect(@as(@TypeOf(add), @ptrCast(frame.function)) == add);
- },
- else => unreachable,
- }
-}
-
test "Declarations are returned in declaration order" {
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
diff --git a/test/cases/compile_errors/async/Frame_of_generic_function.zig b/test/cases/compile_errors/async/Frame_of_generic_function.zig
@@ -1,14 +0,0 @@
-export fn entry() void {
- var frame: @Frame(func) = undefined;
- _ = &frame;
-}
-fn func(comptime T: type) void {
- var x: T = undefined;
- _ = &x;
-}
-
-// error
-// backend=stage1
-// target=native
-//
-// tmp.zig:2:16: error: @Frame() of generic function
diff --git a/test/cases/compile_errors/async/bad_alignment_in_asynccall.zig b/test/cases/compile_errors/async/bad_alignment_in_asynccall.zig
@@ -1,13 +0,0 @@
-export fn entry() void {
- var ptr: fn () callconv(.@"async") void = func;
- var bytes: [64]u8 = undefined;
- _ = @asyncCall(&bytes, {}, ptr, .{});
- _ = &ptr;
-}
-fn func() callconv(.@"async") void {}
-
-// error
-// backend=stage1
-// target=aarch64-linux-none
-//
-// tmp.zig:4:21: error: expected type '[]align(8) u8', found '*[64]u8'
diff --git a/test/cases/compile_errors/async/exported_async_function.zig b/test/cases/compile_errors/async/exported_async_function.zig
@@ -1,7 +0,0 @@
-export fn foo() callconv(.@"async") void {}
-
-// error
-// backend=stage1
-// target=native
-//
-// tmp.zig:1:1: error: exported function cannot be async
diff --git a/test/cases/compile_errors/async/frame_called_outside_of_function_definition.zig b/test/cases/compile_errors/async/frame_called_outside_of_function_definition.zig
@@ -1,11 +0,0 @@
-var handle_undef: anyframe = undefined;
-var handle_dummy: anyframe = @frame();
-export fn entry() bool {
- return handle_undef == handle_dummy;
-}
-
-// error
-// backend=stage1
-// target=native
-//
-// tmp.zig:2:30: error: @frame() called outside of function definition
diff --git a/test/cases/compile_errors/async/frame_causes_function_to_be_async.zig b/test/cases/compile_errors/async/frame_causes_function_to_be_async.zig
@@ -1,13 +0,0 @@
-export fn entry() void {
- func();
-}
-fn func() void {
- _ = @frame();
-}
-
-// error
-// backend=stage1
-// target=native
-//
-// tmp.zig:1:1: error: function with calling convention 'C' cannot be async
-// tmp.zig:5:9: note: @frame() causes function to be async
diff --git a/test/cases/compile_errors/async/non-async_function_pointer_eventually_is_inferred_to_become_async.zig b/test/cases/compile_errors/async/non-async_function_pointer_eventually_is_inferred_to_become_async.zig
@@ -1,15 +0,0 @@
-export fn a() void {
- var non_async_fn: fn () void = undefined;
- non_async_fn = func;
-}
-fn func() void {
- suspend {}
-}
-
-// error
-// backend=stage1
-// target=native
-//
-// tmp.zig:5:1: error: 'func' cannot be async
-// tmp.zig:3:20: note: required to be non-async here
-// tmp.zig:6:5: note: suspends here
diff --git a/test/cases/compile_errors/async/non_async_function_pointer_passed_to_asyncCall.zig b/test/cases/compile_errors/async/non_async_function_pointer_passed_to_asyncCall.zig
@@ -1,13 +0,0 @@
-export fn entry() void {
- var ptr = afunc;
- var bytes: [100]u8 align(16) = undefined;
- _ = @asyncCall(&bytes, {}, ptr, .{});
- _ = &ptr;
-}
-fn afunc() void {}
-
-// error
-// backend=stage1
-// target=native
-//
-// tmp.zig:4:32: error: expected async function, found 'fn () void'
diff --git a/test/cases/compile_errors/async/prevent_bad_implicit_casting_of_anyframe_types.zig b/test/cases/compile_errors/async/prevent_bad_implicit_casting_of_anyframe_types.zig
@@ -1,24 +0,0 @@
-export fn a() void {
- var x: anyframe = undefined;
- var y: anyframe->i32 = x;
- _ = .{ &x, &y };
-}
-export fn b() void {
- var x: i32 = undefined;
- var y: anyframe->i32 = x;
- _ = .{ &x, &y };
-}
-export fn c() void {
- var x: @Frame(func) = undefined;
- var y: anyframe->i32 = &x;
- _ = .{ &x, &y };
-}
-fn func() void {}
-
-// error
-// backend=stage1
-// target=native
-//
-// :3:28: error: expected type 'anyframe->i32', found 'anyframe'
-// :8:28: error: expected type 'anyframe->i32', found 'i32'
-// tmp.zig:13:29: error: expected type 'anyframe->i32', found '*@Frame(func)'
diff --git a/test/cases/compile_errors/async/wrong_type_for_argument_tuple_to_asyncCall.zig b/test/cases/compile_errors/async/wrong_type_for_argument_tuple_to_asyncCall.zig
@@ -1,14 +0,0 @@
-export fn entry1() void {
- var frame: @Frame(foo) = undefined;
- @asyncCall(&frame, {}, foo, {});
-}
-
-fn foo() i32 {
- return 0;
-}
-
-// error
-// backend=stage1
-// target=native
-//
-// tmp.zig:3:33: error: expected tuple or struct, found 'void'
diff --git a/test/cases/safety/nosuspend function call, callee suspends.zig b/test/cases/safety/nosuspend function call, callee suspends.zig
@@ -1,20 +0,0 @@
-const std = @import("std");
-
-pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
- _ = message;
- _ = stack_trace;
- std.process.exit(0);
-}
-pub fn main() !void {
- _ = nosuspend add(101, 100);
- return error.TestFailed;
-}
-fn add(a: i32, b: i32) i32 {
- if (a > 100) {
- suspend {}
- }
- return a + b;
-}
-// run
-// backend=stage1
-// target=native