diff --git a/test/cases/compile_errors/async/Frame_of_generic_function.zig b/test/cases/compile_errors/async/Frame_of_generic_function.zig new file mode 100644 index 0000000000000000000000000000000000000000..d90e53eb4683dba5f55a8e99388d04f47aa91390 --- /dev/null +++ b/test/cases/compile_errors/async/Frame_of_generic_function.zig @@ -0,0 +1,14 @@ +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/async_function_depends_on_its_own_frame.zig b/test/cases/compile_errors/async/async_function_depends_on_its_own_frame.zig new file mode 100644 index 0000000000000000000000000000000000000000..4dde5860bafc4709d376e1703df95b14ce58420f --- /dev/null +++ b/test/cases/compile_errors/async/async_function_depends_on_its_own_frame.zig @@ -0,0 +1,13 @@ +export fn entry() void { + _ = async amain(); +} +fn amain() callconv(.Async) void { + var x: [@sizeOf(@Frame(amain))]u8 = undefined; + _ = x; +} + +// error +// backend=stage1 +// target=native +// +// tmp.zig:4:1: error: cannot resolve '@Frame(amain)': function not fully analyzed yet diff --git a/test/cases/compile_errors/async/async_function_indirectly_depends_on_its_own_frame.zig b/test/cases/compile_errors/async/async_function_indirectly_depends_on_its_own_frame.zig new file mode 100644 index 0000000000000000000000000000000000000000..4dac0d4fa33fbc45db20184af0c0734552b9df81 --- /dev/null +++ b/test/cases/compile_errors/async/async_function_indirectly_depends_on_its_own_frame.zig @@ -0,0 +1,17 @@ +export fn entry() void { + _ = async amain(); +} +fn amain() callconv(.Async) void { + other(); +} +fn other() void { + var x: [@sizeOf(@Frame(amain))]u8 = undefined; + _ = x; +} + +// error +// backend=stage1 +// target=native +// +// tmp.zig:4:1: error: unable to determine async function frame of 'amain' +// tmp.zig:5:10: note: analysis of function 'other' depends on the frame diff --git a/test/cases/compile_errors/async/bad_alignment_in_asynccall.zig b/test/cases/compile_errors/async/bad_alignment_in_asynccall.zig new file mode 100644 index 0000000000000000000000000000000000000000..399914000994b76b44c91e8200b74dafcd7aa1be --- /dev/null +++ b/test/cases/compile_errors/async/bad_alignment_in_asynccall.zig @@ -0,0 +1,12 @@ +export fn entry() void { + var ptr: fn () callconv(.Async) void = func; + var bytes: [64]u8 = undefined; + _ = @asyncCall(&bytes, {}, 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/const_frame_cast_to_anyframe.zig b/test/cases/compile_errors/async/const_frame_cast_to_anyframe.zig new file mode 100644 index 0000000000000000000000000000000000000000..affdb953d72f317ea094a806b6c08aa05c135256 --- /dev/null +++ b/test/cases/compile_errors/async/const_frame_cast_to_anyframe.zig @@ -0,0 +1,19 @@ +export fn a() void { + const f = async func(); + resume f; +} +export fn b() void { + const f = async func(); + var x: anyframe = &f; + _ = x; +} +fn func() void { + suspend {} +} + +// error +// backend=stage1 +// target=native +// +// tmp.zig:3:12: error: expected type 'anyframe', found '*const @Frame(func)' +// tmp.zig:7:24: error: expected type 'anyframe', found '*const @Frame(func)' diff --git a/test/cases/compile_errors/async/exported_async_function.zig b/test/cases/compile_errors/async/exported_async_function.zig new file mode 100644 index 0000000000000000000000000000000000000000..b9ac591227d95ea9cf01595a357c97d4e00950fb --- /dev/null +++ b/test/cases/compile_errors/async/exported_async_function.zig @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..d14099815287f35321510c87104e0a5831a970a6 --- /dev/null +++ b/test/cases/compile_errors/async/frame_called_outside_of_function_definition.zig @@ -0,0 +1,11 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..f8493b08b2c9e3374ee9c5c8297601c397964dea --- /dev/null +++ b/test/cases/compile_errors/async/frame_causes_function_to_be_async.zig @@ -0,0 +1,13 @@ +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/function_with_ccc_indirectly_calling_async_function.zig b/test/cases/compile_errors/async/function_with_ccc_indirectly_calling_async_function.zig new file mode 100644 index 0000000000000000000000000000000000000000..9fadb992b4c68407ab3c65c208d968b29123bf7a --- /dev/null +++ b/test/cases/compile_errors/async/function_with_ccc_indirectly_calling_async_function.zig @@ -0,0 +1,18 @@ +export fn entry() void { + foo(); +} +fn foo() void { + bar(); +} +fn bar() void { + suspend {} +} + +// error +// backend=stage1 +// target=native +// +// tmp.zig:1:1: error: function with calling convention 'C' cannot be async +// tmp.zig:2:8: note: async function call here +// tmp.zig:5:8: note: async function call here +// tmp.zig:8:5: note: suspends here diff --git a/test/cases/compile_errors/async/indirect_recursion_of_async_functions_detected.zig b/test/cases/compile_errors/async/indirect_recursion_of_async_functions_detected.zig new file mode 100644 index 0000000000000000000000000000000000000000..d845dc7930a73e4c85f24b57f9c6432a64bae4d3 --- /dev/null +++ b/test/cases/compile_errors/async/indirect_recursion_of_async_functions_detected.zig @@ -0,0 +1,36 @@ +var frame: ?anyframe = null; + +export fn a() void { + _ = async rangeSum(10); + while (frame) |f| resume f; +} + +fn rangeSum(x: i32) i32 { + suspend { + frame = @frame(); + } + frame = null; + + if (x == 0) return 0; + var child = rangeSumIndirect(x - 1); + return child + 1; +} + +fn rangeSumIndirect(x: i32) i32 { + suspend { + frame = @frame(); + } + frame = null; + + if (x == 0) return 0; + var child = rangeSum(x - 1); + return child + 1; +} + +// error +// backend=stage1 +// target=native +// +// tmp.zig:8:1: error: '@Frame(rangeSum)' depends on itself +// tmp.zig:15:33: note: when analyzing type '@Frame(rangeSum)' here +// tmp.zig:26:25: note: when analyzing type '@Frame(rangeSumIndirect)' here diff --git a/test/cases/compile_errors/async/invalid_suspend_in_exported_function.zig b/test/cases/compile_errors/async/invalid_suspend_in_exported_function.zig new file mode 100644 index 0000000000000000000000000000000000000000..cfcbfba889dfd57b1260ee14df08d354f4973de4 --- /dev/null +++ b/test/cases/compile_errors/async/invalid_suspend_in_exported_function.zig @@ -0,0 +1,15 @@ +export fn entry() void { + var frame = async func(); + var result = await frame; + _ = result; +} +fn func() void { + suspend {} +} + +// error +// backend=stage1 +// target=native +// +// tmp.zig:1:1: error: function with calling convention 'C' cannot be async +// tmp.zig:3:18: note: await here is a suspend point 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 new file mode 100644 index 0000000000000000000000000000000000000000..e18b4200289d80343d38cee2da9101f81916c0f5 --- /dev/null +++ b/test/cases/compile_errors/async/non-async_function_pointer_eventually_is_inferred_to_become_async.zig @@ -0,0 +1,15 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..d8ab4087e0a32dd2971c7bc51e3b662d30281bb0 --- /dev/null +++ b/test/cases/compile_errors/async/non_async_function_pointer_passed_to_asyncCall.zig @@ -0,0 +1,12 @@ +export fn entry() void { + var ptr = afunc; + var bytes: [100]u8 align(16) = undefined; + _ = @asyncCall(&bytes, {}, 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 new file mode 100644 index 0000000000000000000000000000000000000000..066bf1c1078762194d4d509fdf795a6362af8eff --- /dev/null +++ b/test/cases/compile_errors/async/prevent_bad_implicit_casting_of_anyframe_types.zig @@ -0,0 +1,24 @@ +export fn a() void { + var x: anyframe = undefined; + var y: anyframe->i32 = x; + _ = y; +} +export fn b() void { + var x: i32 = undefined; + var y: anyframe->i32 = x; + _ = y; +} +export fn c() void { + var x: @Frame(func) = undefined; + var y: anyframe->i32 = &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)' \ No newline at end of file diff --git a/test/cases/compile_errors/async/returning_error_from_void_async_function.zig b/test/cases/compile_errors/async/returning_error_from_void_async_function.zig new file mode 100644 index 0000000000000000000000000000000000000000..691c89a3478e21324685d27680ec26c13b0fc5f2 --- /dev/null +++ b/test/cases/compile_errors/async/returning_error_from_void_async_function.zig @@ -0,0 +1,12 @@ +export fn entry() void { + _ = async amain(); +} +fn amain() callconv(.Async) void { + return error.ShouldBeCompileError; +} + +// error +// backend=stage1 +// target=native +// +// tmp.zig:5:17: error: expected type 'void', found 'error{ShouldBeCompileError}' diff --git a/test/cases/compile_errors/async/runtime-known_async_function_called.zig b/test/cases/compile_errors/async/runtime-known_async_function_called.zig new file mode 100644 index 0000000000000000000000000000000000000000..90685ce566297391b6924ec1a56cddc2db28aa9a --- /dev/null +++ b/test/cases/compile_errors/async/runtime-known_async_function_called.zig @@ -0,0 +1,14 @@ +export fn entry() void { + _ = async amain(); +} +fn amain() void { + var ptr = afunc; + _ = ptr(); +} +fn afunc() callconv(.Async) void {} + +// error +// backend=stage1 +// target=native +// +// tmp.zig:6:12: error: function is not comptime-known; @asyncCall required diff --git a/test/cases/compile_errors/async/runtime-known_function_called_with_async_keyword.zig b/test/cases/compile_errors/async/runtime-known_function_called_with_async_keyword.zig new file mode 100644 index 0000000000000000000000000000000000000000..c66d0f9cbb557517b1e02bfd271871d2b229243e --- /dev/null +++ b/test/cases/compile_errors/async/runtime-known_function_called_with_async_keyword.zig @@ -0,0 +1,12 @@ +export fn entry() void { + var ptr = afunc; + _ = async ptr(); +} + +fn afunc() callconv(.Async) void { } + +// error +// backend=stage1 +// target=native +// +// tmp.zig:3:15: error: function is not comptime-known; @asyncCall required diff --git a/test/cases/compile_errors/async/wrong_frame_type_used_for_async_call.zig b/test/cases/compile_errors/async/wrong_frame_type_used_for_async_call.zig new file mode 100644 index 0000000000000000000000000000000000000000..c02c20f495d8760272493a144f2054264cf474f6 --- /dev/null +++ b/test/cases/compile_errors/async/wrong_frame_type_used_for_async_call.zig @@ -0,0 +1,16 @@ +export fn entry() void { + var frame: @Frame(foo) = undefined; + frame = async bar(); +} +fn foo() void { + suspend {} +} +fn bar() void { + suspend {} +} + +// error +// backend=stage1 +// target=native +// +// tmp.zig:3:13: error: expected type '*@Frame(bar)', found '*@Frame(foo)' 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 new file mode 100644 index 0000000000000000000000000000000000000000..7a9be0a8cc6e9123a0beb597d4be2683aa7546ff --- /dev/null +++ b/test/cases/compile_errors/async/wrong_type_for_argument_tuple_to_asyncCall.zig @@ -0,0 +1,14 @@ +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/compile_errors/async/wrong_type_for_result_ptr_to_asyncCall.zig b/test/cases/compile_errors/async/wrong_type_for_result_ptr_to_asyncCall.zig new file mode 100644 index 0000000000000000000000000000000000000000..b4193d4de11d50385900de8afa2b18c4ee2d3f74 --- /dev/null +++ b/test/cases/compile_errors/async/wrong_type_for_result_ptr_to_asyncCall.zig @@ -0,0 +1,16 @@ +export fn entry() void { + _ = async amain(); +} +fn amain() i32 { + var frame: @Frame(foo) = undefined; + return await @asyncCall(&frame, false, foo, .{}); +} +fn foo() i32 { + return 1234; +} + +// error +// backend=stage1 +// target=native +// +// tmp.zig:6:37: error: expected type '*i32', found 'bool' diff --git a/test/cases/compile_errors/stage1/obj/Frame_of_generic_function.zig b/test/cases/compile_errors/stage1/obj/Frame_of_generic_function.zig deleted file mode 100644 index d90e53eb4683dba5f55a8e99388d04f47aa91390..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/Frame_of_generic_function.zig +++ /dev/null @@ -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/stage1/obj/async_function_depends_on_its_own_frame.zig b/test/cases/compile_errors/stage1/obj/async_function_depends_on_its_own_frame.zig deleted file mode 100644 index 4dde5860bafc4709d376e1703df95b14ce58420f..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/async_function_depends_on_its_own_frame.zig +++ /dev/null @@ -1,13 +0,0 @@ -export fn entry() void { - _ = async amain(); -} -fn amain() callconv(.Async) void { - var x: [@sizeOf(@Frame(amain))]u8 = undefined; - _ = x; -} - -// error -// backend=stage1 -// target=native -// -// tmp.zig:4:1: error: cannot resolve '@Frame(amain)': function not fully analyzed yet diff --git a/test/cases/compile_errors/stage1/obj/async_function_indirectly_depends_on_its_own_frame.zig b/test/cases/compile_errors/stage1/obj/async_function_indirectly_depends_on_its_own_frame.zig deleted file mode 100644 index 4dac0d4fa33fbc45db20184af0c0734552b9df81..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/async_function_indirectly_depends_on_its_own_frame.zig +++ /dev/null @@ -1,17 +0,0 @@ -export fn entry() void { - _ = async amain(); -} -fn amain() callconv(.Async) void { - other(); -} -fn other() void { - var x: [@sizeOf(@Frame(amain))]u8 = undefined; - _ = x; -} - -// error -// backend=stage1 -// target=native -// -// tmp.zig:4:1: error: unable to determine async function frame of 'amain' -// tmp.zig:5:10: note: analysis of function 'other' depends on the frame diff --git a/test/cases/compile_errors/stage1/obj/bad_alignment_in_asynccall.zig b/test/cases/compile_errors/stage1/obj/bad_alignment_in_asynccall.zig deleted file mode 100644 index 399914000994b76b44c91e8200b74dafcd7aa1be..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/bad_alignment_in_asynccall.zig +++ /dev/null @@ -1,12 +0,0 @@ -export fn entry() void { - var ptr: fn () callconv(.Async) void = func; - var bytes: [64]u8 = undefined; - _ = @asyncCall(&bytes, {}, 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/stage1/obj/const_frame_cast_to_anyframe.zig b/test/cases/compile_errors/stage1/obj/const_frame_cast_to_anyframe.zig deleted file mode 100644 index affdb953d72f317ea094a806b6c08aa05c135256..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/const_frame_cast_to_anyframe.zig +++ /dev/null @@ -1,19 +0,0 @@ -export fn a() void { - const f = async func(); - resume f; -} -export fn b() void { - const f = async func(); - var x: anyframe = &f; - _ = x; -} -fn func() void { - suspend {} -} - -// error -// backend=stage1 -// target=native -// -// tmp.zig:3:12: error: expected type 'anyframe', found '*const @Frame(func)' -// tmp.zig:7:24: error: expected type 'anyframe', found '*const @Frame(func)' diff --git a/test/cases/compile_errors/stage1/obj/exported_async_function.zig b/test/cases/compile_errors/stage1/obj/exported_async_function.zig deleted file mode 100644 index b9ac591227d95ea9cf01595a357c97d4e00950fb..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/exported_async_function.zig +++ /dev/null @@ -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/stage1/obj/frame_called_outside_of_function_definition.zig b/test/cases/compile_errors/stage1/obj/frame_called_outside_of_function_definition.zig deleted file mode 100644 index d14099815287f35321510c87104e0a5831a970a6..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/frame_called_outside_of_function_definition.zig +++ /dev/null @@ -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/stage1/obj/frame_causes_function_to_be_async.zig b/test/cases/compile_errors/stage1/obj/frame_causes_function_to_be_async.zig deleted file mode 100644 index f8493b08b2c9e3374ee9c5c8297601c397964dea..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/frame_causes_function_to_be_async.zig +++ /dev/null @@ -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/stage1/obj/function_with_ccc_indirectly_calling_async_function.zig b/test/cases/compile_errors/stage1/obj/function_with_ccc_indirectly_calling_async_function.zig deleted file mode 100644 index 9fadb992b4c68407ab3c65c208d968b29123bf7a..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/function_with_ccc_indirectly_calling_async_function.zig +++ /dev/null @@ -1,18 +0,0 @@ -export fn entry() void { - foo(); -} -fn foo() void { - bar(); -} -fn bar() void { - suspend {} -} - -// error -// backend=stage1 -// target=native -// -// tmp.zig:1:1: error: function with calling convention 'C' cannot be async -// tmp.zig:2:8: note: async function call here -// tmp.zig:5:8: note: async function call here -// tmp.zig:8:5: note: suspends here diff --git a/test/cases/compile_errors/stage1/obj/indirect_recursion_of_async_functions_detected.zig b/test/cases/compile_errors/stage1/obj/indirect_recursion_of_async_functions_detected.zig deleted file mode 100644 index d845dc7930a73e4c85f24b57f9c6432a64bae4d3..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/indirect_recursion_of_async_functions_detected.zig +++ /dev/null @@ -1,36 +0,0 @@ -var frame: ?anyframe = null; - -export fn a() void { - _ = async rangeSum(10); - while (frame) |f| resume f; -} - -fn rangeSum(x: i32) i32 { - suspend { - frame = @frame(); - } - frame = null; - - if (x == 0) return 0; - var child = rangeSumIndirect(x - 1); - return child + 1; -} - -fn rangeSumIndirect(x: i32) i32 { - suspend { - frame = @frame(); - } - frame = null; - - if (x == 0) return 0; - var child = rangeSum(x - 1); - return child + 1; -} - -// error -// backend=stage1 -// target=native -// -// tmp.zig:8:1: error: '@Frame(rangeSum)' depends on itself -// tmp.zig:15:33: note: when analyzing type '@Frame(rangeSum)' here -// tmp.zig:26:25: note: when analyzing type '@Frame(rangeSumIndirect)' here diff --git a/test/cases/compile_errors/stage1/obj/invalid_suspend_in_exported_function.zig b/test/cases/compile_errors/stage1/obj/invalid_suspend_in_exported_function.zig deleted file mode 100644 index cfcbfba889dfd57b1260ee14df08d354f4973de4..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/invalid_suspend_in_exported_function.zig +++ /dev/null @@ -1,15 +0,0 @@ -export fn entry() void { - var frame = async func(); - var result = await frame; - _ = result; -} -fn func() void { - suspend {} -} - -// error -// backend=stage1 -// target=native -// -// tmp.zig:1:1: error: function with calling convention 'C' cannot be async -// tmp.zig:3:18: note: await here is a suspend point diff --git a/test/cases/compile_errors/stage1/obj/non-async_function_pointer_eventually_is_inferred_to_become_async.zig b/test/cases/compile_errors/stage1/obj/non-async_function_pointer_eventually_is_inferred_to_become_async.zig deleted file mode 100644 index e18b4200289d80343d38cee2da9101f81916c0f5..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/non-async_function_pointer_eventually_is_inferred_to_become_async.zig +++ /dev/null @@ -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/stage1/obj/non_async_function_pointer_passed_to_asyncCall.zig b/test/cases/compile_errors/stage1/obj/non_async_function_pointer_passed_to_asyncCall.zig deleted file mode 100644 index d8ab4087e0a32dd2971c7bc51e3b662d30281bb0..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/non_async_function_pointer_passed_to_asyncCall.zig +++ /dev/null @@ -1,12 +0,0 @@ -export fn entry() void { - var ptr = afunc; - var bytes: [100]u8 align(16) = undefined; - _ = @asyncCall(&bytes, {}, 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/stage1/obj/prevent_bad_implicit_casting_of_anyframe_types.zig b/test/cases/compile_errors/stage1/obj/prevent_bad_implicit_casting_of_anyframe_types.zig deleted file mode 100644 index 066bf1c1078762194d4d509fdf795a6362af8eff..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/prevent_bad_implicit_casting_of_anyframe_types.zig +++ /dev/null @@ -1,24 +0,0 @@ -export fn a() void { - var x: anyframe = undefined; - var y: anyframe->i32 = x; - _ = y; -} -export fn b() void { - var x: i32 = undefined; - var y: anyframe->i32 = x; - _ = y; -} -export fn c() void { - var x: @Frame(func) = undefined; - var y: anyframe->i32 = &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)' \ No newline at end of file diff --git a/test/cases/compile_errors/stage1/obj/returning_error_from_void_async_function.zig b/test/cases/compile_errors/stage1/obj/returning_error_from_void_async_function.zig deleted file mode 100644 index 691c89a3478e21324685d27680ec26c13b0fc5f2..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/returning_error_from_void_async_function.zig +++ /dev/null @@ -1,12 +0,0 @@ -export fn entry() void { - _ = async amain(); -} -fn amain() callconv(.Async) void { - return error.ShouldBeCompileError; -} - -// error -// backend=stage1 -// target=native -// -// tmp.zig:5:17: error: expected type 'void', found 'error{ShouldBeCompileError}' diff --git a/test/cases/compile_errors/stage1/obj/runtime-known_async_function_called.zig b/test/cases/compile_errors/stage1/obj/runtime-known_async_function_called.zig deleted file mode 100644 index 90685ce566297391b6924ec1a56cddc2db28aa9a..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/runtime-known_async_function_called.zig +++ /dev/null @@ -1,14 +0,0 @@ -export fn entry() void { - _ = async amain(); -} -fn amain() void { - var ptr = afunc; - _ = ptr(); -} -fn afunc() callconv(.Async) void {} - -// error -// backend=stage1 -// target=native -// -// tmp.zig:6:12: error: function is not comptime-known; @asyncCall required diff --git a/test/cases/compile_errors/stage1/obj/runtime-known_function_called_with_async_keyword.zig b/test/cases/compile_errors/stage1/obj/runtime-known_function_called_with_async_keyword.zig deleted file mode 100644 index c66d0f9cbb557517b1e02bfd271871d2b229243e..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/runtime-known_function_called_with_async_keyword.zig +++ /dev/null @@ -1,12 +0,0 @@ -export fn entry() void { - var ptr = afunc; - _ = async ptr(); -} - -fn afunc() callconv(.Async) void { } - -// error -// backend=stage1 -// target=native -// -// tmp.zig:3:15: error: function is not comptime-known; @asyncCall required diff --git a/test/cases/compile_errors/stage1/obj/wrong_frame_type_used_for_async_call.zig b/test/cases/compile_errors/stage1/obj/wrong_frame_type_used_for_async_call.zig deleted file mode 100644 index c02c20f495d8760272493a144f2054264cf474f6..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/wrong_frame_type_used_for_async_call.zig +++ /dev/null @@ -1,16 +0,0 @@ -export fn entry() void { - var frame: @Frame(foo) = undefined; - frame = async bar(); -} -fn foo() void { - suspend {} -} -fn bar() void { - suspend {} -} - -// error -// backend=stage1 -// target=native -// -// tmp.zig:3:13: error: expected type '*@Frame(bar)', found '*@Frame(foo)' diff --git a/test/cases/compile_errors/stage1/obj/wrong_type_for_argument_tuple_to_asyncCall.zig b/test/cases/compile_errors/stage1/obj/wrong_type_for_argument_tuple_to_asyncCall.zig deleted file mode 100644 index 7a9be0a8cc6e9123a0beb597d4be2683aa7546ff..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/wrong_type_for_argument_tuple_to_asyncCall.zig +++ /dev/null @@ -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/compile_errors/stage1/obj/wrong_type_for_result_ptr_to_asyncCall.zig b/test/cases/compile_errors/stage1/obj/wrong_type_for_result_ptr_to_asyncCall.zig deleted file mode 100644 index b4193d4de11d50385900de8afa2b18c4ee2d3f74..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/stage1/obj/wrong_type_for_result_ptr_to_asyncCall.zig +++ /dev/null @@ -1,16 +0,0 @@ -export fn entry() void { - _ = async amain(); -} -fn amain() i32 { - var frame: @Frame(foo) = undefined; - return await @asyncCall(&frame, false, foo, .{}); -} -fn foo() i32 { - return 1234; -} - -// error -// backend=stage1 -// target=native -// -// tmp.zig:6:37: error: expected type '*i32', found 'bool'