aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/stage1/behavior/async_fn.zig14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/stage1/behavior/async_fn.zig b/test/stage1/behavior/async_fn.zig
index b5e1d3a63f..fea713b725 100644
--- a/test/stage1/behavior/async_fn.zig
+++ b/test/stage1/behavior/async_fn.zig
@@ -760,3 +760,17 @@ test "async call a generic function" {
};
_ = async S.doTheTest();
}
+
+test "return from suspend block" {
+ const S = struct {
+ fn doTheTest() void {
+ expect(func() == 1234);
+ }
+ fn func() i32 {
+ suspend {
+ return 1234;
+ }
+ }
+ };
+ _ = async S.doTheTest();
+}