| author | |
| committer | |
| log | 67e6df4313a982fa08ab6ec6de1da427aaf83409 |
| tree | 6852bdc53f0eaeb9fce6149fc5692d1377065c3a |
| parent | 69cf40da600224734d39c6f64fb2e0905e42d54a |
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.11 files changed, 0 insertions(+), 158 deletions(-)
test/behavior/type_info.zig-14| ... | @@ -539,20 +539,6 @@ fn add(a: i32, b: i32) i32 { | ... | @@ -539,20 +539,6 @@ fn add(a: i32, b: i32) i32 { |
| 539 | return a + b; | 539 | return a + b; |
| 540 | } | 540 | } |
| 541 | 541 | ||
| 542 | test "type info for async frames" { | ||
| 543 | if (true) { | ||
| 544 | // https://github.com/ziglang/zig/issues/6025 | ||
| 545 | return error.SkipZigTest; | ||
| 546 | } | ||
| 547 | |||
| 548 | switch (@typeInfo(@Frame(add))) { | ||
| 549 | .frame => |frame| { | ||
| 550 | try expect(@as(@TypeOf(add), @ptrCast(frame.function)) == add); | ||
| 551 | }, | ||
| 552 | else => unreachable, | ||
| 553 | } | ||
| 554 | } | ||
| 555 | |||
| 556 | test "Declarations are returned in declaration order" { | 542 | test "Declarations are returned in declaration order" { |
| 557 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 543 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 558 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; | 544 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
test/cases/compile_errors/async/Frame_of_generic_function.zig deleted-14| ... | @@ -1,14 +0,0 @@ | ||
| 1 | export fn entry() void { | ||
| 2 | var frame: @Frame(func) = undefined; | ||
| 3 | _ = &frame; | ||
| 4 | } | ||
| 5 | fn func(comptime T: type) void { | ||
| 6 | var x: T = undefined; | ||
| 7 | _ = &x; | ||
| 8 | } | ||
| 9 | |||
| 10 | // error | ||
| 11 | // backend=stage1 | ||
| 12 | // target=native | ||
| 13 | // | ||
| 14 | // tmp.zig:2:16: error: @Frame() of generic function | ||
test/cases/compile_errors/async/bad_alignment_in_asynccall.zig deleted-13| ... | @@ -1,13 +0,0 @@ | ||
| 1 | export fn entry() void { | ||
| 2 | var ptr: fn () callconv(.@"async") void = func; | ||
| 3 | var bytes: [64]u8 = undefined; | ||
| 4 | _ = @asyncCall(&bytes, {}, ptr, .{}); | ||
| 5 | _ = &ptr; | ||
| 6 | } | ||
| 7 | fn func() callconv(.@"async") void {} | ||
| 8 | |||
| 9 | // error | ||
| 10 | // backend=stage1 | ||
| 11 | // target=aarch64-linux-none | ||
| 12 | // | ||
| 13 | // tmp.zig:4:21: error: expected type '[]align(8) u8', found '*[64]u8' | ||
test/cases/compile_errors/async/exported_async_function.zig deleted-7| ... | @@ -1,7 +0,0 @@ | ||
| 1 | export fn foo() callconv(.@"async") void {} | ||
| 2 | |||
| 3 | // error | ||
| 4 | // backend=stage1 | ||
| 5 | // target=native | ||
| 6 | // | ||
| 7 | // tmp.zig:1:1: error: exported function cannot be async | ||
test/cases/compile_errors/async/frame_called_outside_of_function_definition.zig deleted-11| ... | @@ -1,11 +0,0 @@ | ||
| 1 | var handle_undef: anyframe = undefined; | ||
| 2 | var handle_dummy: anyframe = @frame(); | ||
| 3 | export fn entry() bool { | ||
| 4 | return handle_undef == handle_dummy; | ||
| 5 | } | ||
| 6 | |||
| 7 | // error | ||
| 8 | // backend=stage1 | ||
| 9 | // target=native | ||
| 10 | // | ||
| 11 | // tmp.zig:2:30: error: @frame() called outside of function definition | ||
test/cases/compile_errors/async/frame_causes_function_to_be_async.zig deleted-13| ... | @@ -1,13 +0,0 @@ | ||
| 1 | export fn entry() void { | ||
| 2 | func(); | ||
| 3 | } | ||
| 4 | fn func() void { | ||
| 5 | _ = @frame(); | ||
| 6 | } | ||
| 7 | |||
| 8 | // error | ||
| 9 | // backend=stage1 | ||
| 10 | // target=native | ||
| 11 | // | ||
| 12 | // tmp.zig:1:1: error: function with calling convention 'C' cannot be async | ||
| 13 | // tmp.zig:5:9: note: @frame() causes function to be async | ||
test/cases/compile_errors/async/non-async_function_pointer_eventually_is_inferred_to_become_async.zig deleted-15| ... | @@ -1,15 +0,0 @@ | ||
| 1 | export fn a() void { | ||
| 2 | var non_async_fn: fn () void = undefined; | ||
| 3 | non_async_fn = func; | ||
| 4 | } | ||
| 5 | fn func() void { | ||
| 6 | suspend {} | ||
| 7 | } | ||
| 8 | |||
| 9 | // error | ||
| 10 | // backend=stage1 | ||
| 11 | // target=native | ||
| 12 | // | ||
| 13 | // tmp.zig:5:1: error: 'func' cannot be async | ||
| 14 | // tmp.zig:3:20: note: required to be non-async here | ||
| 15 | // tmp.zig:6:5: note: suspends here | ||
test/cases/compile_errors/async/non_async_function_pointer_passed_to_asyncCall.zig deleted-13| ... | @@ -1,13 +0,0 @@ | ||
| 1 | export fn entry() void { | ||
| 2 | var ptr = afunc; | ||
| 3 | var bytes: [100]u8 align(16) = undefined; | ||
| 4 | _ = @asyncCall(&bytes, {}, ptr, .{}); | ||
| 5 | _ = &ptr; | ||
| 6 | } | ||
| 7 | fn afunc() void {} | ||
| 8 | |||
| 9 | // error | ||
| 10 | // backend=stage1 | ||
| 11 | // target=native | ||
| 12 | // | ||
| 13 | // tmp.zig:4:32: error: expected async function, found 'fn () void' | ||
test/cases/compile_errors/async/prevent_bad_implicit_casting_of_anyframe_types.zig deleted-24| ... | @@ -1,24 +0,0 @@ | ||
| 1 | export fn a() void { | ||
| 2 | var x: anyframe = undefined; | ||
| 3 | var y: anyframe->i32 = x; | ||
| 4 | _ = .{ &x, &y }; | ||
| 5 | } | ||
| 6 | export fn b() void { | ||
| 7 | var x: i32 = undefined; | ||
| 8 | var y: anyframe->i32 = x; | ||
| 9 | _ = .{ &x, &y }; | ||
| 10 | } | ||
| 11 | export fn c() void { | ||
| 12 | var x: @Frame(func) = undefined; | ||
| 13 | var y: anyframe->i32 = &x; | ||
| 14 | _ = .{ &x, &y }; | ||
| 15 | } | ||
| 16 | fn func() void {} | ||
| 17 | |||
| 18 | // error | ||
| 19 | // backend=stage1 | ||
| 20 | // target=native | ||
| 21 | // | ||
| 22 | // :3:28: error: expected type 'anyframe->i32', found 'anyframe' | ||
| 23 | // :8:28: error: expected type 'anyframe->i32', found 'i32' | ||
| 24 | // tmp.zig:13:29: error: expected type 'anyframe->i32', found '*@Frame(func)' | ||
test/cases/compile_errors/async/wrong_type_for_argument_tuple_to_asyncCall.zig deleted-14| ... | @@ -1,14 +0,0 @@ | ||
| 1 | export fn entry1() void { | ||
| 2 | var frame: @Frame(foo) = undefined; | ||
| 3 | @asyncCall(&frame, {}, foo, {}); | ||
| 4 | } | ||
| 5 | |||
| 6 | fn foo() i32 { | ||
| 7 | return 0; | ||
| 8 | } | ||
| 9 | |||
| 10 | // error | ||
| 11 | // backend=stage1 | ||
| 12 | // target=native | ||
| 13 | // | ||
| 14 | // tmp.zig:3:33: error: expected tuple or struct, found 'void' | ||
test/cases/safety/nosuspend function call, callee suspends.zig	 deleted-20| ... | @@ -1,20 +0,0 @@ | ||
| 1 | const std = @import("std"); | ||
| 2 | |||
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { | ||
| 4 | _ = message; | ||
| 5 | _ = stack_trace; | ||
| 6 | std.process.exit(0); | ||
| 7 | } | ||
| 8 | pub fn main() !void { | ||
| 9 | _ = nosuspend add(101, 100); | ||
| 10 | return error.TestFailed; | ||
| 11 | } | ||
| 12 | fn add(a: i32, b: i32) i32 { | ||
| 13 | if (a > 100) { | ||
| 14 | suspend {} | ||
| 15 | } | ||
| 16 | return a + b; | ||
| 17 | } | ||
| 18 | // run | ||
| 19 | // backend=stage1 | ||
| 20 | // target=native | ||