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