| author | |
| committer | |
| log | deda6b514691c3a7ffc7931469886d0e7be2f67e |
| tree | c71ae6f91304fc3d7e68da2fc04fc1fe4154e61f |
| parent | b8473ae7d333ea2750e55e712722d446076e99d9 |
closes #135463 files changed, 28 insertions(+), 8 deletions(-)
ci/linux/build-x86_64-debug.sh+3-7| ... | ... | @@ -51,9 +51,7 @@ stage3-debug/bin/zig fmt --check .. \ |
| 51 | 51 | # simultaneously test building self-hosted without LLVM and with 32-bit arm |
| 52 | 52 | stage3-debug/bin/zig build -Dtarget=arm-linux-musleabihf |
| 53 | 53 | |
| 54 | # building docs disabled due to: | |
| 55 | # https://github.com/ziglang/zig/issues/13546 | |
| 56 | stage3-debug/bin/zig build test \ | |
| 54 | stage3-debug/bin/zig build test docs \ | |
| 57 | 55 | -fqemu \ |
| 58 | 56 | -fwasmtime \ |
| 59 | 57 | -Dstatic-llvm \ |
| ... | ... | @@ -61,10 +59,8 @@ stage3-debug/bin/zig build test \ |
| 61 | 59 | --search-prefix "$PREFIX" \ |
| 62 | 60 | --zig-lib-dir "$(pwd)/../lib" |
| 63 | 61 | |
| 64 | # langref disabled due to: | |
| 65 | # https://github.com/ziglang/zig/issues/13546 | |
| 66 | ## Look for HTML errors. | |
| 67 | #tidy --drop-empty-elements no -qe ../zig-cache/langref.html | |
| 62 | # Look for HTML errors. | |
| 63 | tidy --drop-empty-elements no -qe ../zig-cache/langref.html | |
| 68 | 64 | |
| 69 | 65 | # Produce the experimental std lib documentation. |
| 70 | 66 | stage3-debug/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib |
src/codegen/llvm.zig+4-1| ... | ... | @@ -8136,7 +8136,10 @@ pub const FuncGen = struct { |
| 8136 | 8136 | .write, .noret, .complex => return false, |
| 8137 | 8137 | .tomb => return true, |
| 8138 | 8138 | } |
| 8139 | } else unreachable; | |
| 8139 | } | |
| 8140 | // The only way to get here is to hit the end of a loop instruction | |
| 8141 | // (implicit repeat). | |
| 8142 | return false; | |
| 8140 | 8143 | } |
| 8141 | 8144 | |
| 8142 | 8145 | fn airLoad(fg: *FuncGen, body_tail: []const Air.Inst.Index) !?*llvm.Value { |
test/behavior/while.zig+21| ... | ... | @@ -343,3 +343,24 @@ test "else continue outer while" { |
| 343 | 343 | } else continue; |
| 344 | 344 | } |
| 345 | 345 | } |
| 346 | ||
| 347 | test "try terminating an infinite loop" { | |
| 348 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO | |
| 349 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO | |
| 350 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | |
| 351 | ||
| 352 | // Test coverage for https://github.com/ziglang/zig/issues/13546 | |
| 353 | const Foo = struct { | |
| 354 | trash: i32, | |
| 355 | ||
| 356 | fn bar() anyerror!@This() { | |
| 357 | return .{ .trash = 1234 }; | |
| 358 | } | |
| 359 | }; | |
| 360 | var t = true; | |
| 361 | errdefer t = false; | |
| 362 | try expect(while (true) { | |
| 363 | if (t) break t; | |
| 364 | _ = try Foo.bar(); | |
| 365 | } else unreachable); | |
| 366 | } |