1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
|
(module
(table 1 1 funcref)
(elem (i32.const 0) $tabled)
(func $user (export "user")
(local $x i32)
(local $y f64)
(call $exported)
(call $exported_small)
(call $tabled)
(call $tabled_small)
(call $multi)
(call $multi)
(call $multi_small)
(call $multi_small)
(call $ok)
(drop (call $int))
(drop (call $double))
(local.set $x (call $int2))
(local.set $y (call $double2))
(call $with-local)
(call $with-local2)
(drop (call $return))
(call $multipass)
(call $param (f32.const 12.34) (i64.const 890005350012))
)
(func $exported (export "exported")
(nop)
(nop)
)
(func $exported_small (export "exported_small")
(nop)
)
(func $recursive
(call $recursive)
)
(func $tabled
(nop)
(nop)
)
(func $tabled_small
(nop)
)
(func $cycle1
(call $cycle2)
)
(func $cycle2
(call $cycle1)
)
(func $multi
(nop)
(nop)
)
(func $multi_small
(nop)
)
(func $ok
(drop (i32.const 1))
)
(func $int (result i32)
(i32.const 2)
)
(func $double (result f64)
(f64.const 3.14159)
)
(func $int2 (result i32)
(i32.const 112)
)
(func $double2 (result f64)
(f64.const 113.14159)
)
(func $with-local
(local $x f32)
(local.set $x (f32.const 2.141828))
)
(func $with-local2
(local $y i64)
(local.set $y (i64.const 4))
)
(func $return (result i32)
(return (i32.const 5))
)
(func $multipass
(call $multipass2)
)
(func $multipass2
(drop (i32.const 6))
)
(func $param (param $x f32) (param $y i64)
(local $z f32)
(drop (local.get $x))
(drop (local.get $y))
(drop (local.get $z))
)
)
(module
(func $main (result i32)
(call $func_51)
(i32.const 0)
)
(func $func_51
(unreachable) ;; void function but having unreachable body, when inlined, type must be fixed
)
)
(module
(memory $0 (shared 1 1))
(func $0 (result i32)
(i32.atomic.store16
(i32.const 0)
(i32.const 0)
)
(i32.const 1)
)
(func $1 (result i64)
(drop
(call $0)
)
(i64.const 0)
)
)
;; potential infinite recursion
(module
(func $main
(call $one)
(call $one)
)
(func $one
(call $one)
)
)
;; potential infinite cycling recursion
(module
(func $main
(call $one)
(call $one)
)
(func $one
(call $two)
)
(func $two
(call $one)
)
)
;; make sure to dce, as we may be combining unreachable code with others
(module
(type $0 (func))
(type $1 (func (param i32 i32) (result i32)))
(table 89 89 funcref)
(memory $0 17)
(start $1)
(func $0 (; 0 ;) (type $1) (param $0 i32) (param $1 i32) (result i32)
(i32.store
(i32.const 4)
(local.tee $0
(i32.const 0)
)
)
(i32.store
(i32.add
(local.get $0)
(i32.const 56)
)
(i32.const 0)
)
(i64.store
(i32.const 49)
(i64.load
(i32.const 24)
)
)
(unreachable)
)
(func $1 (; 1 ;) (type $0)
(drop
(call $0
(i32.const 0)
(i32.const 0)
)
)
)
)
|