rust/src/test/run-pass/deep.rs
2011-07-27 15:54:33 +02:00

9 lines
151 B
Rust

// -*- rust -*-
fn f(x: int) -> int {
if x == 1 { ret 1; } else { let y: int = 1 + f(x - 1); ret y; }
}
fn main() { assert (f(5000) == 5000); }