kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

tail_call.wat (355B)


      1 (module
      2   (func $count (param $n i32) (param $acc i32) (result i32)
      3     local.get $n
      4     i32.eqz
      5     if
      6       local.get $acc
      7       return
      8     end
      9     local.get $n
     10     i32.const 1
     11     i32.sub
     12     local.get $acc
     13     i32.const 1
     14     i32.add
     15     return_call $count)
     16   (func (export "test_main") (result i32)
     17     i32.const 42
     18     i32.const 0
     19     call $count))