Skip to content

Commit e0983a1

Browse files
committed
Add workaround for test failing due to #12973
1 parent 948abb3 commit e0983a1

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

test/cases/recursive_inline_function.1.zig

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
// Without storing source locations relative to the owner decl, the compile error
33
// here would be off by 2 bytes (from the "7" -> "999").
44
pub fn main() void {
5+
{
6+
// Waste some of our backward branch quota, to avoid blowing the stack of the compiler
7+
// until https://github.com/ziglang/zig/issues/12973 is fixed
8+
comptime var i: usize = 0;
9+
inline while (i < 900) : (i += 1) {}
10+
}
511
const y = fibonacci(999);
612
if (y - 21 != 0) unreachable;
713
}
@@ -13,8 +19,7 @@ inline fn fibonacci(n: usize) usize {
1319

1420
// error
1521
//
16-
// :11:21: error: evaluation exceeded 1000 backwards branches
17-
// :11:21: note: use @setEvalBranchQuota() to raise the branch limit from 1000
18-
// :11:40: note: called from here (6 times)
19-
// :11:21: note: called from here (495 times)
20-
// :5:24: note: called from here
22+
// :17:21: error: evaluation exceeded 1000 backwards branches
23+
// :17:21: note: use @setEvalBranchQuota() to raise the branch limit from 1000
24+
// :17:21: note: called from here (99 times)
25+
// :11:24: note: called from here

0 commit comments

Comments
 (0)