-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinfer-type.optimized.wat
66 lines (66 loc) · 1.33 KB
/
infer-type.optimized.wat
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
(module
(type $v (func))
(type $i (func (result i32)))
(type $I (func (result i64)))
(type $f (func (result f32)))
(type $F (func (result f64)))
(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))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $infer-type/locals (; 0 ;) (type $v)
(nop)
)
(func $infer-type/reti (; 1 ;) (type $i) (result i32)
(i32.const 0)
)
(func $infer-type/retI (; 2 ;) (type $I) (result i64)
(i64.const 0)
)
(func $infer-type/retf (; 3 ;) (type $f) (result f32)
(f32.const 0)
)
(func $infer-type/refF (; 4 ;) (type $F) (result f64)
(f64.const 0)
)
(func $start (; 5 ;) (type $v)
(local $0 i32)
(local $1 i32)
(call $infer-type/locals)
(set_global $infer-type/ri
(call $infer-type/reti)
)
(set_global $infer-type/rI
(call $infer-type/retI)
)
(set_global $infer-type/rf
(call $infer-type/retf)
)
(set_global $infer-type/rF
(call $infer-type/refF)
)
(set_local $1
(i32.const 10)
)
(loop $continue|0
(if
(i32.lt_s
(get_local $0)
(get_local $1)
)
(block
(set_local $0
(i32.add
(get_local $0)
(i32.const 1)
)
)
(br $continue|0)
)
)
)
)
)