solidity/test/libyul/yulInterpreterTests/recursion.yul
2019-09-02 10:41:26 +02:00

15 lines
322 B
Plaintext

{
function fib(i) -> y {
y := 1
if gt(i, 2) {
y := add(fib(sub(i, 1)), fib(sub(i, 2)))
}
}
sstore(0, fib(8))
}
// ----
// Trace:
// Memory dump:
// Storage dump:
// 0000000000000000000000000000000000000000000000000000000000000000: 0000000000000000000000000000000000000000000000000000000000000015