2017-12-23 13:48:04 +01:00
|
|
|
(module
|
2019-03-01 00:01:23 +01:00
|
|
|
(type $FUNCSIG$v (func))
|
|
|
|
(type $FUNCSIG$i (func (result i32)))
|
|
|
|
(type $FUNCSIG$j (func (result i64)))
|
|
|
|
(type $FUNCSIG$f (func (result f32)))
|
|
|
|
(type $FUNCSIG$d (func (result f64)))
|
|
|
|
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
|
2019-06-05 23:15:39 +02:00
|
|
|
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
|
2018-10-11 08:49:08 +02:00
|
|
|
(memory $0 1)
|
2019-06-05 23:15:39 +02:00
|
|
|
(data (i32.const 8) "\1a\00\00\00\01\00\00\00\01\00\00\00\1a\00\00\00i\00n\00f\00e\00r\00-\00t\00y\00p\00e\00.\00t\00s\00")
|
2019-02-05 17:12:10 +01:00
|
|
|
(table $0 1 funcref)
|
2018-10-11 08:49:08 +02:00
|
|
|
(elem (i32.const 0) $null)
|
2017-12-23 13:48:04 +01:00
|
|
|
(global $infer-type/i i32 (i32.const 10))
|
|
|
|
(global $infer-type/I i64 (i64.const 4294967296))
|
|
|
|
(global $infer-type/F f64 (f64.const 1.5))
|
2017-12-23 17:49:06 +01:00
|
|
|
(global $infer-type/ri (mut i32) (i32.const 0))
|
|
|
|
(global $infer-type/rI (mut i64) (i64.const 0))
|
|
|
|
(global $infer-type/rf (mut f32) (f32.const 0))
|
|
|
|
(global $infer-type/rF (mut f64) (f64.const 0))
|
2018-06-21 22:47:37 +02:00
|
|
|
(global $infer-type/inferi (mut i32) (i32.const -2147483648))
|
|
|
|
(global $infer-type/inferu (mut i32) (i32.const 2147483647))
|
2017-12-23 13:48:04 +01:00
|
|
|
(export "memory" (memory $0))
|
|
|
|
(start $start)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $infer-type/locals (; 1 ;) (type $FUNCSIG$v)
|
2017-12-23 13:48:04 +01:00
|
|
|
(local $0 i32)
|
|
|
|
(local $1 i64)
|
|
|
|
(local $2 f64)
|
|
|
|
(local $3 i32)
|
|
|
|
(local $4 i64)
|
|
|
|
(local $5 f64)
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 10
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i64.const 4294967296
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $1
|
2018-11-08 08:04:24 +01:00
|
|
|
f64.const 1.5
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $2
|
|
|
|
global.get $infer-type/i
|
|
|
|
local.set $3
|
|
|
|
global.get $infer-type/I
|
|
|
|
local.set $4
|
|
|
|
global.get $infer-type/F
|
|
|
|
local.set $5
|
2017-12-23 13:48:04 +01:00
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $infer-type/reti (; 2 ;) (type $FUNCSIG$i) (result i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 0
|
2017-12-23 17:49:06 +01:00
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $infer-type/retI (; 3 ;) (type $FUNCSIG$j) (result i64)
|
2018-11-08 08:04:24 +01:00
|
|
|
i64.const 0
|
2017-12-23 17:49:06 +01:00
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $infer-type/retf (; 4 ;) (type $FUNCSIG$f) (result f32)
|
2018-11-08 08:04:24 +01:00
|
|
|
f32.const 0
|
2017-12-23 17:49:06 +01:00
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $infer-type/refF (; 5 ;) (type $FUNCSIG$d) (result f64)
|
2018-11-08 08:04:24 +01:00
|
|
|
f64.const 0
|
2017-12-23 17:49:06 +01:00
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $start:infer-type (; 6 ;) (type $FUNCSIG$v)
|
2017-12-27 02:37:53 +01:00
|
|
|
(local $0 i32)
|
|
|
|
(local $1 i32)
|
2019-02-05 17:12:10 +01:00
|
|
|
global.get $infer-type/i
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
2019-02-05 17:12:10 +01:00
|
|
|
global.get $infer-type/I
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
2019-02-05 17:12:10 +01:00
|
|
|
global.get $infer-type/F
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
call $infer-type/locals
|
|
|
|
call $infer-type/reti
|
2019-02-05 17:12:10 +01:00
|
|
|
global.set $infer-type/ri
|
|
|
|
global.get $infer-type/ri
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
call $infer-type/retI
|
2019-02-05 17:12:10 +01:00
|
|
|
global.set $infer-type/rI
|
|
|
|
global.get $infer-type/rI
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
call $infer-type/retf
|
2019-02-05 17:12:10 +01:00
|
|
|
global.set $infer-type/rf
|
|
|
|
global.get $infer-type/rf
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
call $infer-type/refF
|
2019-02-05 17:12:10 +01:00
|
|
|
global.set $infer-type/rF
|
|
|
|
global.get $infer-type/rF
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
block $break|0
|
2019-06-11 12:52:16 +02:00
|
|
|
i32.const 0
|
|
|
|
local.set $0
|
|
|
|
i32.const 10
|
|
|
|
local.set $1
|
|
|
|
loop $loop|0
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
|
|
|
local.get $1
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.lt_s
|
|
|
|
i32.eqz
|
|
|
|
br_if $break|0
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.add
|
2019-02-05 17:12:10 +01:00
|
|
|
local.set $0
|
2019-06-11 12:52:16 +02:00
|
|
|
br $loop|0
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
i32.const 0
|
|
|
|
i32.eqz
|
|
|
|
i32.eqz
|
|
|
|
if
|
|
|
|
i32.const 0
|
2019-06-05 23:15:39 +02:00
|
|
|
i32.const 24
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 49
|
|
|
|
i32.const 0
|
2019-06-05 23:15:39 +02:00
|
|
|
call $~lib/builtins/abort
|
2018-11-08 08:04:24 +01:00
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
i32.const 1
|
|
|
|
i32.eqz
|
|
|
|
if
|
|
|
|
i32.const 0
|
2019-06-05 23:15:39 +02:00
|
|
|
i32.const 24
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 52
|
|
|
|
i32.const 0
|
2019-06-05 23:15:39 +02:00
|
|
|
call $~lib/builtins/abort
|
2018-11-08 08:04:24 +01:00
|
|
|
unreachable
|
|
|
|
end
|
2017-12-23 13:48:04 +01:00
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $start (; 7 ;) (type $FUNCSIG$v)
|
2019-02-21 00:11:22 +01:00
|
|
|
call $start:infer-type
|
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $null (; 8 ;) (type $FUNCSIG$v)
|
2018-09-17 01:48:35 +02:00
|
|
|
)
|
2017-12-23 13:48:04 +01:00
|
|
|
)
|