authorgravatar for me@tadeo.caTadeo Kondrak <me@tadeo.ca> 2020-05-05 05:18:29-06:00
committergravatar for me@tadeo.caTadeo Kondrak <me@tadeo.ca> 2020-05-05 05:55:26-06:00
log2c9204032d1c839d8d577113a9c4def4b9ea9b94
tree0e8776be19c1552380dca6f5916e304a77de0773
parentaf00afed9844b9fb17478d33840fb4a312c4f07c
signaturelock-open Commit is signed but in an unrecognized format.

update tests for nosuspend


3 files changed, 10 insertions(+), 10 deletions(-)

test/compile_errors.zig+5-5
......@@ -243,9 +243,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
243243 "tmp.zig:17:17: error: RHS of shift is too large for LHS type",
244244 });
245245
246 cases.addTest("combination of noasync and async",
246 cases.addTest("combination of nosuspend and async",
247247 \\export fn entry() void {
248 \\ noasync {
248 \\ nosuspend {
249249 \\ const bar = async foo();
250250 \\ suspend;
251251 \\ resume bar;
......@@ -253,9 +253,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
253253 \\}
254254 \\fn foo() void {}
255255 , &[_][]const u8{
256 "tmp.zig:3:21: error: async call in noasync scope",
257 "tmp.zig:4:9: error: suspend in noasync scope",
258 "tmp.zig:5:9: error: resume in noasync scope",
256 "tmp.zig:3:21: error: async call in nosuspend scope",
257 "tmp.zig:4:9: error: suspend in nosuspend scope",
258 "tmp.zig:5:9: error: resume in nosuspend scope",
259259 });
260260
261261 cases.add("atomicrmw with bool op not .Xchg",
test/runtime_safety.zig+2-2
......@@ -234,12 +234,12 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
234234 \\}
235235 );
236236
237 cases.addRuntimeSafety("noasync function call, callee suspends",
237 cases.addRuntimeSafety("nosuspend function call, callee suspends",
238238 \\pub fn panic(message: []const u8, stack_trace: ?*@import("builtin").StackTrace) noreturn {
239239 \\ @import("std").os.exit(126);
240240 \\}
241241 \\pub fn main() void {
242 \\ _ = noasync add(101, 100);
242 \\ _ = nosuspend add(101, 100);
243243 \\}
244244 \\fn add(a: i32, b: i32) i32 {
245245 \\ if (a > 100) {
test/stage1/behavior/async_fn.zig+3-3
......@@ -1090,7 +1090,7 @@ test "recursive call of await @asyncCall with struct return type" {
10901090 expect(res.z == 3);
10911091}
10921092
1093test "noasync function call" {
1093test "nosuspend function call" {
10941094 const S = struct {
10951095 fn doTheTest() void {
10961096 const result = nosuspend add(50, 100);
......@@ -1511,7 +1511,7 @@ test "take address of temporary async frame" {
15111511 S.doTheTest();
15121512}
15131513
1514test "noasync await" {
1514test "nosuspend await" {
15151515 const S = struct {
15161516 var finished = false;
15171517
......@@ -1532,7 +1532,7 @@ test "noasync await" {
15321532 expect(S.finished);
15331533}
15341534
1535test "noasync on function calls" {
1535test "nosuspend on function calls" {
15361536 const S0 = struct {
15371537 b: i32 = 42,
15381538 };