blob: 6f5a716f93b0013f3d4670889e1b46715a8d1985 [file] [log] [blame] [edit]
(module
(type $0 (func (param i32)))
(type $1 (func (param i32) (result i32)))
(type $2 (func (param i32 i32) (result i32)))
(type $3 (func (result i32 i64)))
(type $4 (func (param i32 i32 i32) (result i32)))
(type $5 (func (result v128)))
(memory $0 10 10)
(func $basic (type $0) (param $p i32)
(local $x i32)
(local.set $x
(i32.const 10)
)
(call $basic
(i32.const 20)
)
)
(func $split (type $0) (param $p i32)
(local $x i32)
(if
(i32.const 1)
(then
(local.set $x
(i32.const 10)
)
)
)
(call $basic
(i32.add
(local.get $x)
(local.get $x)
)
)
)
(func $split-but-join (type $0) (param $p i32)
(local $x i32)
(if
(i32.const 1)
(then
(local.set $x
(i32.const 10)
)
)
(else
(local.set $x
(i32.const 10)
)
)
)
(call $basic
(i32.const 20)
)
)
(func $split-but-join-different (type $0) (param $p i32)
(local $x i32)
(if
(i32.const 1)
(then
(local.set $x
(i32.const 10)
)
)
(else
(local.set $x
(i32.const 20)
)
)
)
(call $basic
(i32.add
(local.get $x)
(local.get $x)
)
)
)
(func $split-but-join-different-b (type $0) (param $p i32)
(local $x i32)
(if
(i32.const 1)
(then
(local.set $x
(i32.const 10)
)
)
(else
(local.set $x
(local.get $p)
)
)
)
(call $basic
(i32.add
(local.get $x)
(local.get $x)
)
)
)
(func $split-but-join-init0 (type $0) (param $p i32)
(local $x i32)
(if
(i32.const 1)
(then
(local.set $x
(i32.const 0)
)
)
)
(call $basic
(i32.const 0)
)
)
(func $later (type $0) (param $p i32)
(local $x i32)
(local.set $x
(i32.const 10)
)
(call $basic
(i32.const 20)
)
(local.set $x
(i32.const 22)
)
(call $basic
(i32.const 44)
)
(local.set $x
(i32.const 39)
)
)
(func $later2 (type $1) (param $p i32) (result i32)
(local $x i32)
(local.set $x
(i32.const 10)
)
(local.set $x
(i32.const 20)
)
(i32.const 20)
)
(func $two-ways-but-identical (type $1) (param $p i32) (result i32)
(local $x i32)
(local $y i32)
(local.set $x
(i32.const 10)
)
(if
(i32.const 1)
(then
(local.set $y
(i32.const 11)
)
)
(else
(local.set $y
(i32.const 11)
)
)
)
(local.set $y
(i32.const 21)
)
(i32.const 21)
)
(func $two-ways-but-almost-identical (type $1) (param $p i32) (result i32)
(local $x i32)
(local $y i32)
(local.set $x
(i32.const 10)
)
(if
(i32.const 1)
(then
(local.set $y
(i32.const 12)
)
)
(else
(local.set $y
(i32.const 11)
)
)
)
(local.set $y
(i32.add
(i32.const 10)
(local.get $y)
)
)
(local.get $y)
)
(func $deadloop (type $1) (param $p i32) (result i32)
(local $x i32)
(local $y i32)
(loop $loop
(local.set $x
(i32.const 0)
)
(local.set $y
(i32.const 0)
)
(br $loop)
)
)
(func $deadloop2 (type $0) (param $p i32)
(local $x i32)
(local $y i32)
(loop $loop
(local.set $x
(i32.const 0)
)
(local.set $y
(i32.const 0)
)
(call $deadloop2
(i32.const 0)
)
(call $deadloop2
(i32.const 0)
)
(br $loop)
)
)
(func $deadloop3 (type $0) (param $p i32)
(local $x i32)
(local $y i32)
(loop $loop
(local.set $x
(i32.const 0)
)
(local.set $y
(i32.const 0)
)
(call $deadloop2
(i32.const 0)
)
(call $deadloop2
(i32.const 0)
)
(br $loop)
)
)
(func $through-tee (type $2) (param $x i32) (param $y i32) (result i32)
(local.set $x
(local.tee $y
(i32.const 7)
)
)
(return
(i32.const 14)
)
)
(func $through-tee-more (type $2) (param $x i32) (param $y i32) (result i32)
(local.set $x
(i32.eqz
(local.tee $y
(i32.const 7)
)
)
)
(return
(i32.const 7)
)
)
(func $multipass (type $4) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(nop)
(if
(local.get $3)
(then
(local.set $2
(i32.const 0)
)
)
)
(local.get $2)
)
(func $through-fallthrough (type $2) (param $x i32) (param $y i32) (result i32)
(local.set $x
(block (result i32)
(nop)
(local.tee $y
(i32.const 7)
)
)
)
(return
(i32.const 14)
)
)
(func $simd-load (type $5) (result v128)
(local $x v128)
(local.set $x
(v128.load8_splat
(i32.const 0)
)
)
(local.get $x)
)
(func $tuple-local (type $3) (result i32 i64)
(local $i32s (tuple i32 i32))
(local $i64s (tuple i64 i64))
(local.set $i32s
(tuple.make 2
(i32.const 42)
(i32.const 0)
)
)
(local.set $i64s
(tuple.make 2
(i64.const 42)
(i64.const 0)
)
)
(tuple.make 2
(i32.const 42)
(i64.const 0)
)
)
)