aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/endless_loop_in_function_evaluation.zig
blob: 7616bfa5e752d87d0b01a1ebcdbe6385d179f4f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const seventh_fib_number = fibonacci(7);
fn fibonacci(x: i32) i32 {
    return fibonacci(x - 1) + fibonacci(x - 2);
}

export fn entry() usize { return @sizeOf(@TypeOf(&seventh_fib_number)); }

// error
// backend=stage2
// target=native
//
// :3:21: error: evaluation exceeded 1000 backwards branches
// :3:21: note: use @setEvalBranchQuota() to raise the branch limit from 1000
// :3:21: note: called from here (999 times)
// :1:37: note: called from here