2017-12-21 10:14:53 +01:00
|
|
|
(module
|
2019-03-01 00:01:23 +01:00
|
|
|
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
|
|
|
(type $FUNCSIG$v (func))
|
2018-06-28 01:44:32 +02:00
|
|
|
(memory $0 0)
|
2017-12-21 10:14:53 +01:00
|
|
|
(export "memory" (memory $0))
|
2018-07-18 23:49:32 +02:00
|
|
|
(export "fib" (func $recursive/fib))
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $recursive/fib (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.le_s
|
|
|
|
if
|
|
|
|
i32.const 1
|
|
|
|
return
|
|
|
|
end
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.sub
|
|
|
|
call $recursive/fib
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 2
|
|
|
|
i32.sub
|
|
|
|
call $recursive/fib
|
|
|
|
i32.add
|
2017-12-21 10:14:53 +01:00
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $null (; 1 ;) (type $FUNCSIG$v)
|
2018-11-08 08:04:24 +01:00
|
|
|
nop
|
2018-09-17 01:48:35 +02:00
|
|
|
)
|
2017-12-21 10:14:53 +01:00
|
|
|
)
|