authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-03-23 14:06:07-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-03-23 14:06:07-07:00
logf27d3409bdbe4a2b1b59f0b7336e582488e35986
treee1a7049ef9c553c002f56b6307f581b71e927d0c
parenta2b0b0015d8a0c7aff451ae723ed2f30360ca33f

behavior tests: disable failing stage1 test

My previous commit added a new behavior test that passes for stage2 but I forgot to check whether it passes for stage1. Since it does not, it has to be disabled. Additionally, this commit organizes behavior tests; there is no longer a section of tests only passing for stage1. Instead, tests are disabled on an individual basis. There is an except for the file which has global assembly in it.

10 files changed, 237 insertions(+), 26 deletions(-)

test/behavior.zig+18-18
...@@ -4,16 +4,17 @@ test {...@@ -4,16 +4,17 @@ test {
4 _ = @import("behavior/align.zig");4 _ = @import("behavior/align.zig");
5 _ = @import("behavior/alignof.zig");5 _ = @import("behavior/alignof.zig");
6 _ = @import("behavior/array.zig");6 _ = @import("behavior/array.zig");
7 _ = @import("behavior/async_fn.zig");
7 _ = @import("behavior/atomics.zig");8 _ = @import("behavior/atomics.zig");
9 _ = @import("behavior/await_struct.zig");
8 _ = @import("behavior/basic.zig");10 _ = @import("behavior/basic.zig");
9 _ = @import("behavior/bit_shifting.zig");11 _ = @import("behavior/bit_shifting.zig");
10 _ = @import("behavior/bitcast.zig");12 _ = @import("behavior/bitcast.zig");
11 _ = @import("behavior/bitreverse.zig");13 _ = @import("behavior/bitreverse.zig");
12 _ = @import("behavior/byteswap.zig");
13 _ = @import("behavior/byval_arg_var.zig");
14 _ = @import("behavior/bool.zig");14 _ = @import("behavior/bool.zig");
15 _ = @import("behavior/bugs/394.zig");15 _ = @import("behavior/bugs/394.zig");
16 _ = @import("behavior/bugs/421.zig");16 _ = @import("behavior/bugs/421.zig");
17 _ = @import("behavior/bugs/529.zig");
17 _ = @import("behavior/bugs/624.zig");18 _ = @import("behavior/bugs/624.zig");
18 _ = @import("behavior/bugs/655.zig");19 _ = @import("behavior/bugs/655.zig");
19 _ = @import("behavior/bugs/656.zig");20 _ = @import("behavior/bugs/656.zig");
...@@ -22,9 +23,11 @@ test {...@@ -22,9 +23,11 @@ test {
22 _ = @import("behavior/bugs/718.zig");23 _ = @import("behavior/bugs/718.zig");
23 _ = @import("behavior/bugs/726.zig");24 _ = @import("behavior/bugs/726.zig");
24 _ = @import("behavior/bugs/828.zig");25 _ = @import("behavior/bugs/828.zig");
26 _ = @import("behavior/bugs/920.zig");
25 _ = @import("behavior/bugs/1025.zig");27 _ = @import("behavior/bugs/1025.zig");
26 _ = @import("behavior/bugs/1076.zig");28 _ = @import("behavior/bugs/1076.zig");
27 _ = @import("behavior/bugs/1111.zig");29 _ = @import("behavior/bugs/1111.zig");
30 _ = @import("behavior/bugs/1120.zig");
28 _ = @import("behavior/bugs/1277.zig");31 _ = @import("behavior/bugs/1277.zig");
29 _ = @import("behavior/bugs/1310.zig");32 _ = @import("behavior/bugs/1310.zig");
30 _ = @import("behavior/bugs/1381.zig");33 _ = @import("behavior/bugs/1381.zig");
...@@ -61,8 +64,10 @@ test {...@@ -61,8 +64,10 @@ test {
61 _ = @import("behavior/bugs/5474.zig");64 _ = @import("behavior/bugs/5474.zig");
62 _ = @import("behavior/bugs/5487.zig");65 _ = @import("behavior/bugs/5487.zig");
63 _ = @import("behavior/bugs/6456.zig");66 _ = @import("behavior/bugs/6456.zig");
67 _ = @import("behavior/bugs/6781.zig");
64 _ = @import("behavior/bugs/6850.zig");68 _ = @import("behavior/bugs/6850.zig");
65 _ = @import("behavior/bugs/7003.zig");69 _ = @import("behavior/bugs/7003.zig");
70 _ = @import("behavior/bugs/7027.zig");
66 _ = @import("behavior/bugs/7047.zig");71 _ = @import("behavior/bugs/7047.zig");
67 _ = @import("behavior/bugs/7250.zig");72 _ = @import("behavior/bugs/7250.zig");
68 _ = @import("behavior/bugs/9584.zig");73 _ = @import("behavior/bugs/9584.zig");
...@@ -77,6 +82,8 @@ test {...@@ -77,6 +82,8 @@ test {
77 _ = @import("behavior/bugs/11181.zig");82 _ = @import("behavior/bugs/11181.zig");
78 _ = @import("behavior/bugs/11182.zig");83 _ = @import("behavior/bugs/11182.zig");
79 _ = @import("behavior/bugs/11213.zig");84 _ = @import("behavior/bugs/11213.zig");
85 _ = @import("behavior/byteswap.zig");
86 _ = @import("behavior/byval_arg_var.zig");
80 _ = @import("behavior/call.zig");87 _ = @import("behavior/call.zig");
81 _ = @import("behavior/cast.zig");88 _ = @import("behavior/cast.zig");
82 _ = @import("behavior/cast_int.zig");89 _ = @import("behavior/cast_int.zig");
...@@ -88,9 +95,9 @@ test {...@@ -88,9 +95,9 @@ test {
88 _ = @import("behavior/eval.zig");95 _ = @import("behavior/eval.zig");
89 _ = @import("behavior/field_parent_ptr.zig");96 _ = @import("behavior/field_parent_ptr.zig");
90 _ = @import("behavior/floatop.zig");97 _ = @import("behavior/floatop.zig");
98 _ = @import("behavior/fn.zig");
91 _ = @import("behavior/fn_delegation.zig");99 _ = @import("behavior/fn_delegation.zig");
92 _ = @import("behavior/fn_in_struct_in_comptime.zig");100 _ = @import("behavior/fn_in_struct_in_comptime.zig");
93 _ = @import("behavior/fn.zig");
94 _ = @import("behavior/for.zig");101 _ = @import("behavior/for.zig");
95 _ = @import("behavior/generics.zig");102 _ = @import("behavior/generics.zig");
96 _ = @import("behavior/hasdecl.zig");103 _ = @import("behavior/hasdecl.zig");
...@@ -118,6 +125,7 @@ test {...@@ -118,6 +125,7 @@ test {
118 _ = @import("behavior/ref_var_in_if_after_if_2nd_switch_prong.zig");125 _ = @import("behavior/ref_var_in_if_after_if_2nd_switch_prong.zig");
119 _ = @import("behavior/reflection.zig");126 _ = @import("behavior/reflection.zig");
120 _ = @import("behavior/saturating_arithmetic.zig");127 _ = @import("behavior/saturating_arithmetic.zig");
128 _ = @import("behavior/select.zig");
121 _ = @import("behavior/shuffle.zig");129 _ = @import("behavior/shuffle.zig");
122 _ = @import("behavior/sizeof_and_typeof.zig");130 _ = @import("behavior/sizeof_and_typeof.zig");
123 _ = @import("behavior/slice.zig");131 _ = @import("behavior/slice.zig");
...@@ -156,6 +164,13 @@ test {...@@ -156,6 +164,13 @@ test {
156 _ = @import("behavior/decltest.zig");164 _ = @import("behavior/decltest.zig");
157 }165 }
158166
167 if (builtin.os.tag != .wasi) {
168 if (builtin.zig_backend == .stage1) {
169 // TODO get these tests passing with stage2
170 _ = @import("behavior/asm.zig");
171 }
172 }
173
159 if (builtin.zig_backend != .stage2_arm and174 if (builtin.zig_backend != .stage2_arm and
160 builtin.zig_backend != .stage2_x86_64 and175 builtin.zig_backend != .stage2_x86_64 and
161 builtin.zig_backend != .stage2_aarch64 and176 builtin.zig_backend != .stage2_aarch64 and
...@@ -166,19 +181,4 @@ test {...@@ -166,19 +181,4 @@ test {
166 _ = @import("behavior/export.zig");181 _ = @import("behavior/export.zig");
167 _ = @import("behavior/export_self_referential_type_info.zig");182 _ = @import("behavior/export_self_referential_type_info.zig");
168 }183 }
169
170 if (builtin.zig_backend == .stage1) {
171 // TODO get these tests passing with stage2
172 if (builtin.os.tag != .wasi) {
173 _ = @import("behavior/asm.zig");
174 _ = @import("behavior/async_fn.zig");
175 }
176 _ = @import("behavior/await_struct.zig");
177 _ = @import("behavior/bugs/529.zig");
178 _ = @import("behavior/bugs/920.zig");
179 _ = @import("behavior/bugs/1120.zig");
180 _ = @import("behavior/bugs/6781.zig");
181 _ = @import("behavior/bugs/7027.zig");
182 _ = @import("behavior/select.zig");
183 }
184}184}
test/behavior/async_fn.zig+196
...@@ -8,6 +8,9 @@ const expectError = std.testing.expectError;...@@ -8,6 +8,9 @@ const expectError = std.testing.expectError;
8var global_x: i32 = 1;8var global_x: i32 = 1;
99
10test "simple coroutine suspend and resume" {10test "simple coroutine suspend and resume" {
11 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
12 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
13
11 var frame = async simpleAsyncFn();14 var frame = async simpleAsyncFn();
12 try expect(global_x == 2);15 try expect(global_x == 2);
13 resume frame;16 resume frame;
...@@ -28,6 +31,9 @@ fn simpleAsyncFn() void {...@@ -28,6 +31,9 @@ fn simpleAsyncFn() void {
28var global_y: i32 = 1;31var global_y: i32 = 1;
2932
30test "pass parameter to coroutine" {33test "pass parameter to coroutine" {
34 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
35 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
36
31 var p = async simpleAsyncFnWithArg(2);37 var p = async simpleAsyncFnWithArg(2);
32 try expect(global_y == 3);38 try expect(global_y == 3);
33 resume p;39 resume p;
...@@ -40,6 +46,9 @@ fn simpleAsyncFnWithArg(delta: i32) void {...@@ -40,6 +46,9 @@ fn simpleAsyncFnWithArg(delta: i32) void {
40}46}
4147
42test "suspend at end of function" {48test "suspend at end of function" {
49 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
50 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
51
43 const S = struct {52 const S = struct {
44 var x: i32 = 1;53 var x: i32 = 1;
4554
...@@ -59,6 +68,9 @@ test "suspend at end of function" {...@@ -59,6 +68,9 @@ test "suspend at end of function" {
59}68}
6069
61test "local variable in async function" {70test "local variable in async function" {
71 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
72 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
73
62 const S = struct {74 const S = struct {
63 var x: i32 = 0;75 var x: i32 = 0;
6476
...@@ -88,6 +100,9 @@ test "local variable in async function" {...@@ -88,6 +100,9 @@ test "local variable in async function" {
88}100}
89101
90test "calling an inferred async function" {102test "calling an inferred async function" {
103 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
104 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
105
91 const S = struct {106 const S = struct {
92 var x: i32 = 1;107 var x: i32 = 1;
93 var other_frame: *@Frame(other) = undefined;108 var other_frame: *@Frame(other) = undefined;
...@@ -112,6 +127,9 @@ test "calling an inferred async function" {...@@ -112,6 +127,9 @@ test "calling an inferred async function" {
112}127}
113128
114test "@frameSize" {129test "@frameSize" {
130 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
131 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
132
115 if (builtin.target.cpu.arch == .thumb or builtin.target.cpu.arch == .thumbeb)133 if (builtin.target.cpu.arch == .thumb or builtin.target.cpu.arch == .thumbeb)
116 return error.SkipZigTest;134 return error.SkipZigTest;
117135
...@@ -143,6 +161,9 @@ test "@frameSize" {...@@ -143,6 +161,9 @@ test "@frameSize" {
143}161}
144162
145test "coroutine suspend, resume" {163test "coroutine suspend, resume" {
164 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
165 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
166
146 const S = struct {167 const S = struct {
147 var frame: anyframe = undefined;168 var frame: anyframe = undefined;
148169
...@@ -184,6 +205,9 @@ test "coroutine suspend, resume" {...@@ -184,6 +205,9 @@ test "coroutine suspend, resume" {
184}205}
185206
186test "coroutine suspend with block" {207test "coroutine suspend with block" {
208 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
209 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
210
187 const p = async testSuspendBlock();211 const p = async testSuspendBlock();
188 _ = p;212 _ = p;
189 try expect(!global_result);213 try expect(!global_result);
...@@ -210,6 +234,9 @@ var await_a_promise: anyframe = undefined;...@@ -210,6 +234,9 @@ var await_a_promise: anyframe = undefined;
210var await_final_result: i32 = 0;234var await_final_result: i32 = 0;
211235
212test "coroutine await" {236test "coroutine await" {
237 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
238 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
239
213 await_seq('a');240 await_seq('a');
214 var p = async await_amain();241 var p = async await_amain();
215 _ = p;242 _ = p;
...@@ -247,6 +274,9 @@ fn await_seq(c: u8) void {...@@ -247,6 +274,9 @@ fn await_seq(c: u8) void {
247var early_final_result: i32 = 0;274var early_final_result: i32 = 0;
248275
249test "coroutine await early return" {276test "coroutine await early return" {
277 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
278 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
279
250 early_seq('a');280 early_seq('a');
251 var p = async early_amain();281 var p = async early_amain();
252 _ = p;282 _ = p;
...@@ -275,6 +305,9 @@ fn early_seq(c: u8) void {...@@ -275,6 +305,9 @@ fn early_seq(c: u8) void {
275}305}
276306
277test "async function with dot syntax" {307test "async function with dot syntax" {
308 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
309 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
310
278 const S = struct {311 const S = struct {
279 var y: i32 = 1;312 var y: i32 = 1;
280 fn foo() callconv(.Async) void {313 fn foo() callconv(.Async) void {
...@@ -288,6 +321,9 @@ test "async function with dot syntax" {...@@ -288,6 +321,9 @@ test "async function with dot syntax" {
288}321}
289322
290test "async fn pointer in a struct field" {323test "async fn pointer in a struct field" {
324 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
325 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
326
291 var data: i32 = 1;327 var data: i32 = 1;
292 const Foo = struct {328 const Foo = struct {
293 bar: fn (*i32) callconv(.Async) void,329 bar: fn (*i32) callconv(.Async) void,
...@@ -313,6 +349,9 @@ fn simpleAsyncFn2(y: *i32) callconv(.Async) void {...@@ -313,6 +349,9 @@ fn simpleAsyncFn2(y: *i32) callconv(.Async) void {
313}349}
314350
315test "@asyncCall with return type" {351test "@asyncCall with return type" {
352 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
353 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
354
316 const Foo = struct {355 const Foo = struct {
317 bar: fn () callconv(.Async) i32,356 bar: fn () callconv(.Async) i32,
318357
...@@ -337,6 +376,9 @@ test "@asyncCall with return type" {...@@ -337,6 +376,9 @@ test "@asyncCall with return type" {
337}376}
338377
339test "async fn with inferred error set" {378test "async fn with inferred error set" {
379 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
380 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
381
340 const S = struct {382 const S = struct {
341 var global_frame: anyframe = undefined;383 var global_frame: anyframe = undefined;
342384
...@@ -367,6 +409,9 @@ test "async fn with inferred error set" {...@@ -367,6 +409,9 @@ test "async fn with inferred error set" {
367}409}
368410
369test "error return trace across suspend points - early return" {411test "error return trace across suspend points - early return" {
412 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
413 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
414
370 const p = nonFailing();415 const p = nonFailing();
371 resume p;416 resume p;
372 const p2 = async printTrace(p);417 const p2 = async printTrace(p);
...@@ -374,6 +419,9 @@ test "error return trace across suspend points - early return" {...@@ -374,6 +419,9 @@ test "error return trace across suspend points - early return" {
374}419}
375420
376test "error return trace across suspend points - async return" {421test "error return trace across suspend points - async return" {
422 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
423 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
424
377 const p = nonFailing();425 const p = nonFailing();
378 const p2 = async printTrace(p);426 const p2 = async printTrace(p);
379 _ = p2;427 _ = p2;
...@@ -404,6 +452,9 @@ fn printTrace(p: anyframe->(anyerror!void)) callconv(.Async) void {...@@ -404,6 +452,9 @@ fn printTrace(p: anyframe->(anyerror!void)) callconv(.Async) void {
404}452}
405453
406test "break from suspend" {454test "break from suspend" {
455 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
456 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
457
407 var my_result: i32 = 1;458 var my_result: i32 = 1;
408 const p = async testBreakFromSuspend(&my_result);459 const p = async testBreakFromSuspend(&my_result);
409 _ = p;460 _ = p;
...@@ -419,6 +470,9 @@ fn testBreakFromSuspend(my_result: *i32) callconv(.Async) void {...@@ -419,6 +470,9 @@ fn testBreakFromSuspend(my_result: *i32) callconv(.Async) void {
419}470}
420471
421test "heap allocated async function frame" {472test "heap allocated async function frame" {
473 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
474 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
475
422 const S = struct {476 const S = struct {
423 var x: i32 = 42;477 var x: i32 = 42;
424478
...@@ -443,6 +497,9 @@ test "heap allocated async function frame" {...@@ -443,6 +497,9 @@ test "heap allocated async function frame" {
443}497}
444498
445test "async function call return value" {499test "async function call return value" {
500 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
501 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
502
446 const S = struct {503 const S = struct {
447 var frame: anyframe = undefined;504 var frame: anyframe = undefined;
448 var pt = Point{ .x = 10, .y = 11 };505 var pt = Point{ .x = 10, .y = 11 };
...@@ -484,6 +541,9 @@ test "async function call return value" {...@@ -484,6 +541,9 @@ test "async function call return value" {
484}541}
485542
486test "suspension points inside branching control flow" {543test "suspension points inside branching control flow" {
544 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
545 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
546
487 const S = struct {547 const S = struct {
488 var result: i32 = 10;548 var result: i32 = 10;
489549
...@@ -510,6 +570,9 @@ test "suspension points inside branching control flow" {...@@ -510,6 +570,9 @@ test "suspension points inside branching control flow" {
510}570}
511571
512test "call async function which has struct return type" {572test "call async function which has struct return type" {
573 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
574 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
575
513 const S = struct {576 const S = struct {
514 var frame: anyframe = undefined;577 var frame: anyframe = undefined;
515578
...@@ -543,6 +606,9 @@ test "call async function which has struct return type" {...@@ -543,6 +606,9 @@ test "call async function which has struct return type" {
543}606}
544607
545test "pass string literal to async function" {608test "pass string literal to async function" {
609 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
610 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
611
546 const S = struct {612 const S = struct {
547 var frame: anyframe = undefined;613 var frame: anyframe = undefined;
548 var ok: bool = false;614 var ok: bool = false;
...@@ -564,6 +630,9 @@ test "pass string literal to async function" {...@@ -564,6 +630,9 @@ test "pass string literal to async function" {
564}630}
565631
566test "await inside an errdefer" {632test "await inside an errdefer" {
633 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
634 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
635
567 const S = struct {636 const S = struct {
568 var frame: anyframe = undefined;637 var frame: anyframe = undefined;
569638
...@@ -587,6 +656,9 @@ test "await inside an errdefer" {...@@ -587,6 +656,9 @@ test "await inside an errdefer" {
587}656}
588657
589test "try in an async function with error union and non-zero-bit payload" {658test "try in an async function with error union and non-zero-bit payload" {
659 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
660 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
661
590 const S = struct {662 const S = struct {
591 var frame: anyframe = undefined;663 var frame: anyframe = undefined;
592 var ok = false;664 var ok = false;
...@@ -617,6 +689,9 @@ test "try in an async function with error union and non-zero-bit payload" {...@@ -617,6 +689,9 @@ test "try in an async function with error union and non-zero-bit payload" {
617}689}
618690
619test "returning a const error from async function" {691test "returning a const error from async function" {
692 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
693 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
694
620 const S = struct {695 const S = struct {
621 var frame: anyframe = undefined;696 var frame: anyframe = undefined;
622 var ok = false;697 var ok = false;
...@@ -648,6 +723,9 @@ test "returning a const error from async function" {...@@ -648,6 +723,9 @@ test "returning a const error from async function" {
648}723}
649724
650test "async/await typical usage" {725test "async/await typical usage" {
726 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
727 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
728
651 inline for ([_]bool{ false, true }) |b1| {729 inline for ([_]bool{ false, true }) |b1| {
652 inline for ([_]bool{ false, true }) |b2| {730 inline for ([_]bool{ false, true }) |b2| {
653 inline for ([_]bool{ false, true }) |b3| {731 inline for ([_]bool{ false, true }) |b3| {
...@@ -743,6 +821,9 @@ fn testAsyncAwaitTypicalUsage(...@@ -743,6 +821,9 @@ fn testAsyncAwaitTypicalUsage(
743}821}
744822
745test "alignment of local variables in async functions" {823test "alignment of local variables in async functions" {
824 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
825 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
826
746 const S = struct {827 const S = struct {
747 fn doTheTest() !void {828 fn doTheTest() !void {
748 var y: u8 = 123;829 var y: u8 = 123;
...@@ -755,6 +836,9 @@ test "alignment of local variables in async functions" {...@@ -755,6 +836,9 @@ test "alignment of local variables in async functions" {
755}836}
756837
757test "no reason to resolve frame still works" {838test "no reason to resolve frame still works" {
839 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
840 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
841
758 _ = async simpleNothing();842 _ = async simpleNothing();
759}843}
760fn simpleNothing() void {844fn simpleNothing() void {
...@@ -763,6 +847,9 @@ fn simpleNothing() void {...@@ -763,6 +847,9 @@ fn simpleNothing() void {
763}847}
764848
765test "async call a generic function" {849test "async call a generic function" {
850 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
851 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
852
766 const S = struct {853 const S = struct {
767 fn doTheTest() !void {854 fn doTheTest() !void {
768 var f = async func(i32, 2);855 var f = async func(i32, 2);
...@@ -783,6 +870,9 @@ test "async call a generic function" {...@@ -783,6 +870,9 @@ test "async call a generic function" {
783}870}
784871
785test "return from suspend block" {872test "return from suspend block" {
873 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
874 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
875
786 const S = struct {876 const S = struct {
787 fn doTheTest() !void {877 fn doTheTest() !void {
788 expect(func() == 1234) catch @panic("test failure");878 expect(func() == 1234) catch @panic("test failure");
...@@ -797,6 +887,9 @@ test "return from suspend block" {...@@ -797,6 +887,9 @@ test "return from suspend block" {
797}887}
798888
799test "struct parameter to async function is copied to the frame" {889test "struct parameter to async function is copied to the frame" {
890 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
891 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
892
800 const S = struct {893 const S = struct {
801 const Point = struct {894 const Point = struct {
802 x: i32,895 x: i32,
...@@ -841,6 +934,9 @@ test "struct parameter to async function is copied to the frame" {...@@ -841,6 +934,9 @@ test "struct parameter to async function is copied to the frame" {
841}934}
842935
843test "cast fn to async fn when it is inferred to be async" {936test "cast fn to async fn when it is inferred to be async" {
937 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
938 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
939
844 const S = struct {940 const S = struct {
845 var frame: anyframe = undefined;941 var frame: anyframe = undefined;
846 var ok = false;942 var ok = false;
...@@ -869,6 +965,9 @@ test "cast fn to async fn when it is inferred to be async" {...@@ -869,6 +965,9 @@ test "cast fn to async fn when it is inferred to be async" {
869}965}
870966
871test "cast fn to async fn when it is inferred to be async, awaited directly" {967test "cast fn to async fn when it is inferred to be async, awaited directly" {
968 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
969 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
970
872 const S = struct {971 const S = struct {
873 var frame: anyframe = undefined;972 var frame: anyframe = undefined;
874 var ok = false;973 var ok = false;
...@@ -896,6 +995,9 @@ test "cast fn to async fn when it is inferred to be async, awaited directly" {...@@ -896,6 +995,9 @@ test "cast fn to async fn when it is inferred to be async, awaited directly" {
896}995}
897996
898test "await does not force async if callee is blocking" {997test "await does not force async if callee is blocking" {
998 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
999 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1000
899 const S = struct {1001 const S = struct {
900 fn simple() i32 {1002 fn simple() i32 {
901 return 1234;1003 return 1234;
...@@ -906,6 +1008,9 @@ test "await does not force async if callee is blocking" {...@@ -906,6 +1008,9 @@ test "await does not force async if callee is blocking" {
906}1008}
9071009
908test "recursive async function" {1010test "recursive async function" {
1011 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1012 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1013
909 try expect(recursiveAsyncFunctionTest(false).doTheTest() == 55);1014 try expect(recursiveAsyncFunctionTest(false).doTheTest() == 55);
910 try expect(recursiveAsyncFunctionTest(true).doTheTest() == 55);1015 try expect(recursiveAsyncFunctionTest(true).doTheTest() == 55);
911}1016}
...@@ -968,6 +1073,9 @@ fn recursiveAsyncFunctionTest(comptime suspending_implementation: bool) type {...@@ -968,6 +1073,9 @@ fn recursiveAsyncFunctionTest(comptime suspending_implementation: bool) type {
968}1073}
9691074
970test "@asyncCall with comptime-known function, but not awaited directly" {1075test "@asyncCall with comptime-known function, but not awaited directly" {
1076 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1077 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1078
971 const S = struct {1079 const S = struct {
972 var global_frame: anyframe = undefined;1080 var global_frame: anyframe = undefined;
9731081
...@@ -997,6 +1105,9 @@ test "@asyncCall with comptime-known function, but not awaited directly" {...@@ -997,6 +1105,9 @@ test "@asyncCall with comptime-known function, but not awaited directly" {
997}1105}
9981106
999test "@asyncCall with actual frame instead of byte buffer" {1107test "@asyncCall with actual frame instead of byte buffer" {
1108 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1109 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1110
1000 const S = struct {1111 const S = struct {
1001 fn func() i32 {1112 fn func() i32 {
1002 suspend {}1113 suspend {}
...@@ -1011,6 +1122,9 @@ test "@asyncCall with actual frame instead of byte buffer" {...@@ -1011,6 +1122,9 @@ test "@asyncCall with actual frame instead of byte buffer" {
1011}1122}
10121123
1013test "@asyncCall using the result location inside the frame" {1124test "@asyncCall using the result location inside the frame" {
1125 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1126 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1127
1014 const S = struct {1128 const S = struct {
1015 fn simple2(y: *i32) callconv(.Async) i32 {1129 fn simple2(y: *i32) callconv(.Async) i32 {
1016 defer y.* += 2;1130 defer y.* += 2;
...@@ -1038,6 +1152,9 @@ test "@asyncCall using the result location inside the frame" {...@@ -1038,6 +1152,9 @@ test "@asyncCall using the result location inside the frame" {
1038}1152}
10391153
1040test "@TypeOf an async function call of generic fn with error union type" {1154test "@TypeOf an async function call of generic fn with error union type" {
1155 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1156 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1157
1041 const S = struct {1158 const S = struct {
1042 fn func(comptime x: anytype) anyerror!i32 {1159 fn func(comptime x: anytype) anyerror!i32 {
1043 const T = @TypeOf(async func(x));1160 const T = @TypeOf(async func(x));
...@@ -1049,6 +1166,9 @@ test "@TypeOf an async function call of generic fn with error union type" {...@@ -1049,6 +1166,9 @@ test "@TypeOf an async function call of generic fn with error union type" {
1049}1166}
10501167
1051test "using @TypeOf on a generic function call" {1168test "using @TypeOf on a generic function call" {
1169 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1170 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1171
1052 const S = struct {1172 const S = struct {
1053 var global_frame: anyframe = undefined;1173 var global_frame: anyframe = undefined;
1054 var global_ok = false;1174 var global_ok = false;
...@@ -1074,6 +1194,9 @@ test "using @TypeOf on a generic function call" {...@@ -1074,6 +1194,9 @@ test "using @TypeOf on a generic function call" {
1074}1194}
10751195
1076test "recursive call of await @asyncCall with struct return type" {1196test "recursive call of await @asyncCall with struct return type" {
1197 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1198 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1199
1077 const S = struct {1200 const S = struct {
1078 var global_frame: anyframe = undefined;1201 var global_frame: anyframe = undefined;
1079 var global_ok = false;1202 var global_ok = false;
...@@ -1110,6 +1233,9 @@ test "recursive call of await @asyncCall with struct return type" {...@@ -1110,6 +1233,9 @@ test "recursive call of await @asyncCall with struct return type" {
1110}1233}
11111234
1112test "nosuspend function call" {1235test "nosuspend function call" {
1236 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1237 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1238
1113 const S = struct {1239 const S = struct {
1114 fn doTheTest() !void {1240 fn doTheTest() !void {
1115 const result = nosuspend add(50, 100);1241 const result = nosuspend add(50, 100);
...@@ -1126,6 +1252,9 @@ test "nosuspend function call" {...@@ -1126,6 +1252,9 @@ test "nosuspend function call" {
1126}1252}
11271253
1128test "await used in expression and awaiting fn with no suspend but async calling convention" {1254test "await used in expression and awaiting fn with no suspend but async calling convention" {
1255 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1256 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1257
1129 const S = struct {1258 const S = struct {
1130 fn atest() void {1259 fn atest() void {
1131 var f1 = async add(1, 2);1260 var f1 = async add(1, 2);
...@@ -1142,6 +1271,9 @@ test "await used in expression and awaiting fn with no suspend but async calling...@@ -1142,6 +1271,9 @@ test "await used in expression and awaiting fn with no suspend but async calling
1142}1271}
11431272
1144test "await used in expression after a fn call" {1273test "await used in expression after a fn call" {
1274 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1275 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1276
1145 const S = struct {1277 const S = struct {
1146 fn atest() void {1278 fn atest() void {
1147 var f1 = async add(3, 4);1279 var f1 = async add(3, 4);
...@@ -1160,6 +1292,9 @@ test "await used in expression after a fn call" {...@@ -1160,6 +1292,9 @@ test "await used in expression after a fn call" {
1160}1292}
11611293
1162test "async fn call used in expression after a fn call" {1294test "async fn call used in expression after a fn call" {
1295 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1296 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1297
1163 const S = struct {1298 const S = struct {
1164 fn atest() void {1299 fn atest() void {
1165 var sum: i32 = 0;1300 var sum: i32 = 0;
...@@ -1177,6 +1312,9 @@ test "async fn call used in expression after a fn call" {...@@ -1177,6 +1312,9 @@ test "async fn call used in expression after a fn call" {
1177}1312}
11781313
1179test "suspend in for loop" {1314test "suspend in for loop" {
1315 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1316 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1317
1180 const S = struct {1318 const S = struct {
1181 var global_frame: ?anyframe = null;1319 var global_frame: ?anyframe = null;
11821320
...@@ -1203,6 +1341,9 @@ test "suspend in for loop" {...@@ -1203,6 +1341,9 @@ test "suspend in for loop" {
1203}1341}
12041342
1205test "suspend in while loop" {1343test "suspend in while loop" {
1344 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1345 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1346
1206 const S = struct {1347 const S = struct {
1207 var global_frame: ?anyframe = null;1348 var global_frame: ?anyframe = null;
12081349
...@@ -1240,6 +1381,9 @@ test "suspend in while loop" {...@@ -1240,6 +1381,9 @@ test "suspend in while loop" {
1240}1381}
12411382
1242test "correctly spill when returning the error union result of another async fn" {1383test "correctly spill when returning the error union result of another async fn" {
1384 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1385 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1386
1243 const S = struct {1387 const S = struct {
1244 var global_frame: anyframe = undefined;1388 var global_frame: anyframe = undefined;
12451389
...@@ -1263,6 +1407,9 @@ test "correctly spill when returning the error union result of another async fn"...@@ -1263,6 +1407,9 @@ test "correctly spill when returning the error union result of another async fn"
1263}1407}
12641408
1265test "spill target expr in a for loop" {1409test "spill target expr in a for loop" {
1410 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1411 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1412
1266 const S = struct {1413 const S = struct {
1267 var global_frame: anyframe = undefined;1414 var global_frame: anyframe = undefined;
12681415
...@@ -1294,6 +1441,9 @@ test "spill target expr in a for loop" {...@@ -1294,6 +1441,9 @@ test "spill target expr in a for loop" {
1294}1441}
12951442
1296test "spill target expr in a for loop, with a var decl in the loop body" {1443test "spill target expr in a for loop, with a var decl in the loop body" {
1444 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1445 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1446
1297 const S = struct {1447 const S = struct {
1298 var global_frame: anyframe = undefined;1448 var global_frame: anyframe = undefined;
12991449
...@@ -1330,6 +1480,9 @@ test "spill target expr in a for loop, with a var decl in the loop body" {...@@ -1330,6 +1480,9 @@ test "spill target expr in a for loop, with a var decl in the loop body" {
1330}1480}
13311481
1332test "async call with @call" {1482test "async call with @call" {
1483 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1484 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1485
1333 const S = struct {1486 const S = struct {
1334 var global_frame: anyframe = undefined;1487 var global_frame: anyframe = undefined;
1335 fn doTheTest() void {1488 fn doTheTest() void {
...@@ -1352,6 +1505,9 @@ test "async call with @call" {...@@ -1352,6 +1505,9 @@ test "async call with @call" {
1352}1505}
13531506
1354test "async function passed 0-bit arg after non-0-bit arg" {1507test "async function passed 0-bit arg after non-0-bit arg" {
1508 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1509 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1510
1355 const S = struct {1511 const S = struct {
1356 var global_frame: anyframe = undefined;1512 var global_frame: anyframe = undefined;
1357 var global_int: i32 = 0;1513 var global_int: i32 = 0;
...@@ -1373,6 +1529,9 @@ test "async function passed 0-bit arg after non-0-bit arg" {...@@ -1373,6 +1529,9 @@ test "async function passed 0-bit arg after non-0-bit arg" {
1373}1529}
13741530
1375test "async function passed align(16) arg after align(8) arg" {1531test "async function passed align(16) arg after align(8) arg" {
1532 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1533 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1534
1376 const S = struct {1535 const S = struct {
1377 var global_frame: anyframe = undefined;1536 var global_frame: anyframe = undefined;
1378 var global_int: u128 = 0;1537 var global_int: u128 = 0;
...@@ -1395,6 +1554,9 @@ test "async function passed align(16) arg after align(8) arg" {...@@ -1395,6 +1554,9 @@ test "async function passed align(16) arg after align(8) arg" {
1395}1554}
13961555
1397test "async function call resolves target fn frame, comptime func" {1556test "async function call resolves target fn frame, comptime func" {
1557 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1558 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1559
1398 const S = struct {1560 const S = struct {
1399 var global_frame: anyframe = undefined;1561 var global_frame: anyframe = undefined;
1400 var global_int: i32 = 9;1562 var global_int: i32 = 9;
...@@ -1417,6 +1579,9 @@ test "async function call resolves target fn frame, comptime func" {...@@ -1417,6 +1579,9 @@ test "async function call resolves target fn frame, comptime func" {
1417}1579}
14181580
1419test "async function call resolves target fn frame, runtime func" {1581test "async function call resolves target fn frame, runtime func" {
1582 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1583 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1584
1420 const S = struct {1585 const S = struct {
1421 var global_frame: anyframe = undefined;1586 var global_frame: anyframe = undefined;
1422 var global_int: i32 = 9;1587 var global_int: i32 = 9;
...@@ -1440,6 +1605,9 @@ test "async function call resolves target fn frame, runtime func" {...@@ -1440,6 +1605,9 @@ test "async function call resolves target fn frame, runtime func" {
1440}1605}
14411606
1442test "properly spill optional payload capture value" {1607test "properly spill optional payload capture value" {
1608 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1609 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1610
1443 const S = struct {1611 const S = struct {
1444 var global_frame: anyframe = undefined;1612 var global_frame: anyframe = undefined;
1445 var global_int: usize = 2;1613 var global_int: usize = 2;
...@@ -1464,6 +1632,9 @@ test "properly spill optional payload capture value" {...@@ -1464,6 +1632,9 @@ test "properly spill optional payload capture value" {
1464}1632}
14651633
1466test "handle defer interfering with return value spill" {1634test "handle defer interfering with return value spill" {
1635 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1636 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1637
1467 const S = struct {1638 const S = struct {
1468 var global_frame1: anyframe = undefined;1639 var global_frame1: anyframe = undefined;
1469 var global_frame2: anyframe = undefined;1640 var global_frame2: anyframe = undefined;
...@@ -1504,6 +1675,9 @@ test "handle defer interfering with return value spill" {...@@ -1504,6 +1675,9 @@ test "handle defer interfering with return value spill" {
1504}1675}
15051676
1506test "take address of temporary async frame" {1677test "take address of temporary async frame" {
1678 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1679 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1680
1507 const S = struct {1681 const S = struct {
1508 var global_frame: anyframe = undefined;1682 var global_frame: anyframe = undefined;
1509 var finished = false;1683 var finished = false;
...@@ -1533,6 +1707,9 @@ test "take address of temporary async frame" {...@@ -1533,6 +1707,9 @@ test "take address of temporary async frame" {
1533}1707}
15341708
1535test "nosuspend await" {1709test "nosuspend await" {
1710 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1711 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1712
1536 const S = struct {1713 const S = struct {
1537 var finished = false;1714 var finished = false;
15381715
...@@ -1554,6 +1731,9 @@ test "nosuspend await" {...@@ -1554,6 +1731,9 @@ test "nosuspend await" {
1554}1731}
15551732
1556test "nosuspend on function calls" {1733test "nosuspend on function calls" {
1734 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1735 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1736
1557 const S0 = struct {1737 const S0 = struct {
1558 b: i32 = 42,1738 b: i32 = 42,
1559 };1739 };
...@@ -1570,6 +1750,9 @@ test "nosuspend on function calls" {...@@ -1570,6 +1750,9 @@ test "nosuspend on function calls" {
1570}1750}
15711751
1572test "nosuspend on async function calls" {1752test "nosuspend on async function calls" {
1753 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1754 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1755
1573 const S0 = struct {1756 const S0 = struct {
1574 b: i32 = 42,1757 b: i32 = 42,
1575 };1758 };
...@@ -1588,6 +1771,7 @@ test "nosuspend on async function calls" {...@@ -1588,6 +1771,7 @@ test "nosuspend on async function calls" {
1588}1771}
15891772
1590// test "resume nosuspend async function calls" {1773// test "resume nosuspend async function calls" {
1774// if (builtin.zig_backend != .stage1) return error.SkipZigTest; // if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1591// const S0 = struct {1775// const S0 = struct {
1592// b: i32 = 42,1776// b: i32 = 42,
1593// };1777// };
...@@ -1610,6 +1794,9 @@ test "nosuspend on async function calls" {...@@ -1610,6 +1794,9 @@ test "nosuspend on async function calls" {
1610// }1794// }
16111795
1612test "nosuspend resume async function calls" {1796test "nosuspend resume async function calls" {
1797 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1798 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1799
1613 const S0 = struct {1800 const S0 = struct {
1614 b: i32 = 42,1801 b: i32 = 42,
1615 };1802 };
...@@ -1632,6 +1819,9 @@ test "nosuspend resume async function calls" {...@@ -1632,6 +1819,9 @@ test "nosuspend resume async function calls" {
1632}1819}
16331820
1634test "avoid forcing frame alignment resolution implicit cast to *anyopaque" {1821test "avoid forcing frame alignment resolution implicit cast to *anyopaque" {
1822 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1823 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1824
1635 const S = struct {1825 const S = struct {
1636 var x: ?*anyopaque = null;1826 var x: ?*anyopaque = null;
16371827
...@@ -1648,6 +1838,9 @@ test "avoid forcing frame alignment resolution implicit cast to *anyopaque" {...@@ -1648,6 +1838,9 @@ test "avoid forcing frame alignment resolution implicit cast to *anyopaque" {
1648}1838}
16491839
1650test "@asyncCall with pass-by-value arguments" {1840test "@asyncCall with pass-by-value arguments" {
1841 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1842 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1843
1651 const F0: u64 = 0xbeefbeefbeefbeef;1844 const F0: u64 = 0xbeefbeefbeefbeef;
1652 const F1: u64 = 0xf00df00df00df00d;1845 const F1: u64 = 0xf00df00df00df00d;
1653 const F2: u64 = 0xcafecafecafecafe;1846 const F2: u64 = 0xcafecafecafecafe;
...@@ -1681,6 +1874,9 @@ test "@asyncCall with pass-by-value arguments" {...@@ -1681,6 +1874,9 @@ test "@asyncCall with pass-by-value arguments" {
1681}1874}
16821875
1683test "@asyncCall with arguments having non-standard alignment" {1876test "@asyncCall with arguments having non-standard alignment" {
1877 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
1878 if (builtin.os.tag == .wasi) return error.SkipZigTest; // TODO
1879
1684 const F0: u64 = 0xbeefbeef;1880 const F0: u64 = 0xbeefbeef;
1685 const F1: u64 = 0xf00df00df00df00d;1881 const F1: u64 = 0xf00df00df00df00d;
16861882
test/behavior/await_struct.zig+2
...@@ -10,6 +10,8 @@ var await_a_promise: anyframe = undefined;...@@ -10,6 +10,8 @@ var await_a_promise: anyframe = undefined;
10var await_final_result = Foo{ .x = 0 };10var await_final_result = Foo{ .x = 0 };
1111
12test "coroutine await struct" {12test "coroutine await struct" {
13 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
14
13 await_seq('a');15 await_seq('a');
14 var p = async await_amain();16 var p = async await_amain();
15 _ = p;17 _ = p;
test/behavior/bugs/1120.zig+2
...@@ -11,6 +11,8 @@ const B = packed struct {...@@ -11,6 +11,8 @@ const B = packed struct {
11 b: u6,11 b: u6,
12};12};
13test "bug 1120" {13test "bug 1120" {
14 if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
15
14 var a = A{ .a = 2, .b = 2 };16 var a = A{ .a = 2, .b = 2 };
15 var b = B{ .q = 22, .a = 3, .b = 2 };17 var b = B{ .q = 22, .a = 3, .b = 2 };
16 var t: usize = 0;18 var t: usize = 0;
test/behavior/bugs/529.zig+2
...@@ -9,6 +9,8 @@ comptime {...@@ -9,6 +9,8 @@ comptime {
9}9}
1010
11test "issue 529 fixed" {11test "issue 529 fixed" {
12 if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
13
12 @import("529_other_file.zig").issue529(null);14 @import("529_other_file.zig").issue529(null);
13 issue529(null);15 issue529(null);
14}16}
test/behavior/bugs/6781.zig+2
...@@ -61,6 +61,8 @@ pub const JournalHeader = packed struct {...@@ -61,6 +61,8 @@ pub const JournalHeader = packed struct {
61};61};
6262
63test "fixed" {63test "fixed" {
64 if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
65
64 var buffer = [_]u8{0} ** 65536;66 var buffer = [_]u8{0} ** 65536;
65 var entry = std.mem.bytesAsValue(JournalHeader, buffer[0..@sizeOf(JournalHeader)]);67 var entry = std.mem.bytesAsValue(JournalHeader, buffer[0..@sizeOf(JournalHeader)]);
66 entry.* = .{68 entry.* = .{
test/behavior/bugs/7027.zig+3-1
...@@ -13,7 +13,9 @@ fn foo(arg: anytype) void {...@@ -13,7 +13,9 @@ fn foo(arg: anytype) void {
13 _ = arg;13 _ = arg;
14}14}
1515
16test "" {16test {
17 if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
18
17 comptime var foobar = Foobar.foo();19 comptime var foobar = Foobar.foo();
18 foo(foobar.str[0..10]);20 foo(foobar.str[0..10]);
19}21}
test/behavior/bugs/920.zig+2
...@@ -57,6 +57,8 @@ const NormalDist = blk: {...@@ -57,6 +57,8 @@ const NormalDist = blk: {
57};57};
5858
59test "bug 920 fixed" {59test "bug 920 fixed" {
60 if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
61
60 const NormalDist1 = blk: {62 const NormalDist1 = blk: {
61 break :blk ZigTableGen(true, norm_r, norm_v, norm_f, norm_f_inv, norm_zero_case);63 break :blk ZigTableGen(true, norm_r, norm_v, norm_f, norm_f_inv, norm_zero_case);
62 };64 };
test/behavior/eval.zig+2
...@@ -833,6 +833,8 @@ test "const type-annotated local initialized with function call has correct type...@@ -833,6 +833,8 @@ test "const type-annotated local initialized with function call has correct type
833}833}
834834
835test "comptime pointer load through elem_ptr" {835test "comptime pointer load through elem_ptr" {
836 if (builtin.zig_backend == .stage1) return error.SkipZigTest; // stage1 fails this test
837
836 const S = struct {838 const S = struct {
837 x: usize,839 x: usize,
838 };840 };
test/behavior/select.zig+8-7
...@@ -2,20 +2,21 @@ const std = @import("std");...@@ -2,20 +2,21 @@ const std = @import("std");
2const builtin = @import("builtin");2const builtin = @import("builtin");
3const mem = std.mem;3const mem = std.mem;
4const expect = std.testing.expect;4const expect = std.testing.expect;
5const Vector = std.meta.Vector;
65
7test "@select" {6test "@select" {
7 if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
8
8 const S = struct {9 const S = struct {
9 fn doTheTest() !void {10 fn doTheTest() !void {
10 var a: Vector(4, bool) = [4]bool{ true, false, true, false };11 var a: @Vector(4, bool) = [4]bool{ true, false, true, false };
11 var b: Vector(4, i32) = [4]i32{ -1, 4, 999, -31 };12 var b: @Vector(4, i32) = [4]i32{ -1, 4, 999, -31 };
12 var c: Vector(4, i32) = [4]i32{ -5, 1, 0, 1234 };13 var c: @Vector(4, i32) = [4]i32{ -5, 1, 0, 1234 };
13 var abc = @select(i32, a, b, c);14 var abc = @select(i32, a, b, c);
14 try expect(mem.eql(i32, &@as([4]i32, abc), &[4]i32{ -1, 1, 999, 1234 }));15 try expect(mem.eql(i32, &@as([4]i32, abc), &[4]i32{ -1, 1, 999, 1234 }));
1516
16 var x: Vector(4, bool) = [4]bool{ false, false, false, true };17 var x: @Vector(4, bool) = [4]bool{ false, false, false, true };
17 var y: Vector(4, f32) = [4]f32{ 0.001, 33.4, 836, -3381.233 };18 var y: @Vector(4, f32) = [4]f32{ 0.001, 33.4, 836, -3381.233 };
18 var z: Vector(4, f32) = [4]f32{ 0.0, 312.1, -145.9, 9993.55 };19 var z: @Vector(4, f32) = [4]f32{ 0.0, 312.1, -145.9, 9993.55 };
19 var xyz = @select(f32, x, y, z);20 var xyz = @select(f32, x, y, z);
20 try expect(mem.eql(f32, &@as([4]f32, xyz), &[4]f32{ 0.0, 312.1, -145.9, -3381.233 }));21 try expect(mem.eql(f32, &@as([4]f32, xyz), &[4]f32{ 0.0, 312.1, -145.9, -3381.233 }));
21 }22 }