authorgravatar for topolarity@tapscott.meCody Tapscott <topolarity@tapscott.me> 2022-10-15 14:45:12-07:00
committergravatar for topolarity@tapscott.meCody Tapscott <topolarity@tapscott.me> 2022-10-21 12:40:33-07:00
log74b9cbd8950f4752c5c80925a8baa5fb2492d99f
tree8874899e671955a29902823aca84ec1dbac0cf79
parenta4523a2d4a0fb2b5c660a11aa37718080eebe9d0

stage2: Skip test exposing #13175

This PR (#12873) in combination with this particular test exposed a pre-existing bug (#13175). This means that the test for #13038 has regressed

1 files changed, 30 insertions(+), 8 deletions(-)

test/behavior/eval.zig+30-8
...@@ -1401,7 +1401,21 @@ test "continue in inline for inside a comptime switch" {...@@ -1401,7 +1401,21 @@ test "continue in inline for inside a comptime switch" {
1401 try expect(count == 4);1401 try expect(count == 4);
1402}1402}
14031403
1404test "length of global array is determinable at comptime" {
1405 const S = struct {
1406 var bytes: [1024]u8 = undefined;
1407
1408 fn foo() !void {
1409 try std.testing.expect(bytes.len == 1024);
1410 }
1411 };
1412 comptime try S.foo();
1413}
1414
1404test "continue nested inline for loop" {1415test "continue nested inline for loop" {
1416 // TODO: https://github.com/ziglang/zig/issues/13175
1417 if (builtin.zig_backend != .stage1) return error.SkipZigTest;
1418
1405 var a: u8 = 0;1419 var a: u8 = 0;
1406 loop: inline for ([_]u8{ 1, 2 }) |x| {1420 loop: inline for ([_]u8{ 1, 2 }) |x| {
1407 inline for ([_]u8{1}) |y| {1421 inline for ([_]u8{1}) |y| {
...@@ -1415,13 +1429,21 @@ test "continue nested inline for loop" {...@@ -1415,13 +1429,21 @@ test "continue nested inline for loop" {
1415 try expect(a == 2);1429 try expect(a == 2);
1416}1430}
14171431
1418test "length of global array is determinable at comptime" {1432test "continue nested inline for loop in named block expr" {
1419 const S = struct {1433 // TODO: https://github.com/ziglang/zig/issues/13175
1420 var bytes: [1024]u8 = undefined;1434 if (builtin.zig_backend != .stage1) return error.SkipZigTest;
14211435
1422 fn foo() !void {1436 var a: u8 = 0;
1423 try std.testing.expect(bytes.len == 1024);1437 loop: inline for ([_]u8{ 1, 2 }) |x| {
1424 }1438 a = b: {
1425 };1439 inline for ([_]u8{1}) |y| {
1426 comptime try S.foo();1440 if (x == y) {
1441 continue :loop;
1442 }
1443 }
1444 break :b x;
1445 };
1446 try expect(x == 2);
1447 }
1448 try expect(a == 2);
1427}1449}