|
1 | 1 | ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. |
2 | | -;; RUN: foreach %s %t wasm-opt --gsi -all --closed-world -S -o - | filecheck %s |
3 | 2 |
|
4 | | -;; Non-type-based optimizations in --gsi |
| 3 | +;; RUN: foreach %s %t wasm-opt --gsi -all -S -o - | filecheck %s |
| 4 | +;; RUN: foreach %s %t wasm-opt --gsi --closed-world -all -S -o - | filecheck %s |
| 5 | + |
| 6 | +;; Non-type-based optimizations in --gsi, which work in open world too. |
5 | 7 |
|
6 | 8 | ;; Create an immutable vtable in an immutable global, which we can optimize |
7 | 9 | ;; with. |
8 | 10 | (module |
9 | 11 | ;; CHECK: (type $vtable (struct (field funcref))) |
10 | 12 | (type $vtable (struct funcref)) |
11 | 13 |
|
| 14 | + |
12 | 15 | ;; CHECK: (type $1 (func)) |
13 | 16 |
|
14 | 17 | ;; CHECK: (import "a" "b" (global $imported funcref)) |
|
43 | 46 | ;; CHECK: (type $vtable (struct (field funcref))) |
44 | 47 | (type $vtable (struct funcref)) |
45 | 48 |
|
| 49 | + |
46 | 50 | ;; CHECK: (type $1 (func)) |
47 | 51 |
|
48 | 52 | ;; CHECK: (import "a" "b" (global $imported funcref)) |
|
79 | 83 | ;; CHECK: (type $vtable (struct (field funcref))) |
80 | 84 | (type $vtable (struct funcref)) |
81 | 85 |
|
| 86 | + |
82 | 87 | ;; CHECK: (type $1 (func)) |
83 | 88 |
|
84 | 89 | ;; CHECK: (import "a" "b" (global $imported funcref)) |
|
109 | 114 | ;; CHECK: (type $table (struct (field anyref))) |
110 | 115 | (type $table (struct anyref)) |
111 | 116 |
|
| 117 | + |
112 | 118 | ;; CHECK: (type $1 (func)) |
113 | 119 |
|
114 | 120 | ;; CHECK: (import "a" "b" (global $imported funcref)) |
115 | 121 | (import "a" "b" (global $imported funcref)) |
116 | 122 |
|
| 123 | + |
117 | 124 | ;; CHECK: (global $table.unnested.0 (ref (exact $table)) (struct.new_default $table)) |
118 | 125 |
|
119 | 126 | ;; CHECK: (global $table (ref $table) (struct.new $table |
|
149 | 156 | (type $desc (sub (describes $struct (struct)))) |
150 | 157 | ) |
151 | 158 |
|
| 159 | + |
152 | 160 | ;; CHECK: (type $2 (func)) |
153 | 161 |
|
154 | 162 | ;; CHECK: (import "a" "b" (global $imported (ref (exact $desc)))) |
|
183 | 191 | ;; CHECK: (type $vtable (struct (field funcref))) |
184 | 192 | (type $vtable (struct funcref)) |
185 | 193 |
|
| 194 | + |
186 | 195 | ;; CHECK: (type $1 (func)) |
187 | 196 |
|
188 | 197 | ;; CHECK: (import "a" "b" (global $imported (ref $vtable))) |
|
209 | 218 | ;; CHECK: (type $A (struct (field i8))) |
210 | 219 | (type $A (struct (field i8))) |
211 | 220 |
|
| 221 | + |
212 | 222 | ;; CHECK: (type $1 (func)) |
213 | 223 |
|
214 | 224 | ;; CHECK: (global $global (ref $A) (struct.new $A |
|
246 | 256 | (type $A.desc (sub (describes $A (struct)))) |
247 | 257 | ) |
248 | 258 |
|
| 259 | + |
249 | 260 | ;; CHECK: (type $2 (func (result (ref $A.desc)))) |
250 | 261 |
|
251 | 262 | ;; CHECK: (global $global (ref $A) (struct.new_default $A |
|
279 | 290 | (type $inner (sub (struct (field (ref $func))))) |
280 | 291 | ) |
281 | 292 |
|
| 293 | + |
| 294 | + |
282 | 295 | ;; CHECK: (type $3 (func (result anyref))) |
283 | 296 |
|
284 | 297 | ;; CHECK: (global $global.unnested.0 (ref (exact $inner)) (struct.new $inner |
|
0 commit comments