Skip to content

Commit

Permalink
Add workaround for test failing due to ziglang#12973
Browse files Browse the repository at this point in the history
  • Loading branch information
topolarity committed Sep 26, 2022
1 parent e9caaab commit 2b1f1de
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/cases/recursive_inline_function.1.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
// Without storing source locations relative to the owner decl, the compile error
// here would be off by 2 bytes (from the "7" -> "999").
pub fn main() void {
{
// Waste some of our backward branch quota, to avoid blowing the stack of the compiler
// until https://github.com/ziglang/zig/issues/12973 is fixed
comptime var i: usize = 0;
inline while (i < 900) : (i += 1) {}
}
const y = fibonacci(999);
if (y - 21 != 0) unreachable;
}
Expand All @@ -13,8 +19,7 @@ inline fn fibonacci(n: usize) usize {

// error
//
// :11:21: error: evaluation exceeded 1000 backwards branches
// :11:21: note: use @setEvalBranchQuota() to raise the branch limit from 1000
// :11:40: note: called from here (6 times)
// :11:21: note: called from here (495 times)
// :5:24: note: called from here
// :17:21: error: evaluation exceeded 1000 backwards branches
// :17:21: note: use @setEvalBranchQuota() to raise the branch limit from 1000
// :17:21: note: called from here (99 times)
// :11:24: note: called from here

0 comments on commit 2b1f1de

Please sign in to comment.