| ... | @@ -349,9 +349,9 @@ fn numberLiteralArg(a: anytype) !void { | ... | @@ -349,9 +349,9 @@ fn numberLiteralArg(a: anytype) !void { |
| 349 | } | 349 | } |
| 350 | | 350 | |
| 351 | test "function call with anon list literal" { | 351 | test "function call with anon list literal" { |
| 352 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | 352 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| 353 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 353 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 354 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 354 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 355 | | 355 | |
| 356 | const S = struct { | 356 | const S = struct { |
| 357 | fn doTheTest() !void { | 357 | fn doTheTest() !void { |
| ... | @@ -363,19 +363,31 @@ test "function call with anon list literal" { | ... | @@ -363,19 +363,31 @@ test "function call with anon list literal" { |
| 363 | try expect(vec[1] == 8); | 363 | try expect(vec[1] == 8); |
| 364 | try expect(vec[2] == 7); | 364 | try expect(vec[2] == 7); |
| 365 | } | 365 | } |
| | 366 | }; |
| | 367 | try S.doTheTest(); |
| | 368 | comptime try S.doTheTest(); |
| | 369 | } |
| | 370 | |
| | 371 | test "function call with anon list literal - 2D" { |
| | 372 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| | 373 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| | 374 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| | 375 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 366 | | 376 | |
| 367 | fn doThe2DTest() !void { | 377 | const S = struct { |
| 368 | try consume2DVec(.{ .{ 9, 8 }, .{ 7, 6 } }); | 378 | fn doTheTest() !void { |
| | 379 | try consumeVec(.{ .{ 9, 8 }, .{ 7, 6 } }); |
| 369 | } | 380 | } |
| 370 | | 381 | |
| 371 | fn consume2DVec(vec: [2][2]f32) !void { | 382 | fn consumeVec(vec: [2][2]f32) !void { |
| 372 | _ = vec; | 383 | try expect(vec[0][0] == 9); |
| | 384 | try expect(vec[0][1] == 8); |
| | 385 | try expect(vec[1][0] == 7); |
| | 386 | try expect(vec[1][1] == 6); |
| 373 | } | 387 | } |
| 374 | }; | 388 | }; |
| 375 | try S.doTheTest(); | 389 | try S.doTheTest(); |
| 376 | comptime try S.doTheTest(); | 390 | comptime try S.doTheTest(); |
| 377 | try S.doThe2DTest(); | | |
| 378 | comptime try S.doThe2DTest(); | | |
| 379 | } | 391 | } |
| 380 | | 392 | |
| 381 | test "ability to give comptime types and non comptime types to same parameter" { | 393 | test "ability to give comptime types and non comptime types to same parameter" { |