|
21 | 21 | (import "a" "ef4" (func (result i32))) ;; index 4 |
22 | 22 | (table $t0 30 30 funcref) |
23 | 23 | (table $t1 30 30 funcref) |
24 | | - |
| 24 | + |
25 | 25 | (elem (table $t0) (i32.const 2) func 3 1 4 1) |
26 | 26 | (elem funcref |
27 | 27 | (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8)) |
|
80 | 80 | (import "a" "ef4" (func (result i32))) ;; index 4 |
81 | 81 | (table $t0 30 30 funcref) |
82 | 82 | (table $t1 30 30 funcref) |
83 | | - |
| 83 | + |
84 | 84 | (elem (table $t0) (i32.const 2) func 3 1 4 1) |
85 | 85 | (elem funcref |
86 | 86 | (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8)) |
|
139 | 139 | (import "a" "ef4" (func (result i32))) ;; index 4 |
140 | 140 | (table $t0 30 30 funcref) |
141 | 141 | (table $t1 30 30 funcref) |
142 | | - |
| 142 | + |
143 | 143 | (elem (table $t0) (i32.const 2) func 3 1 4 1) |
144 | 144 | (elem funcref |
145 | 145 | (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8)) |
|
206 | 206 | (import "a" "ef4" (func (result i32))) ;; index 4 |
207 | 207 | (table $t0 30 30 funcref) |
208 | 208 | (table $t1 30 30 funcref) |
209 | | - |
| 209 | + |
210 | 210 | (elem (table $t1) (i32.const 2) func 3 1 4 1) |
211 | 211 | (elem funcref |
212 | 212 | (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8)) |
|
265 | 265 | (import "a" "ef4" (func (result i32))) ;; index 4 |
266 | 266 | (table $t0 30 30 funcref) |
267 | 267 | (table $t1 30 30 funcref) |
268 | | - |
| 268 | + |
269 | 269 | (elem (table $t1) (i32.const 2) func 3 1 4 1) |
270 | 270 | (elem funcref |
271 | 271 | (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8)) |
|
324 | 324 | (import "a" "ef4" (func (result i32))) ;; index 4 |
325 | 325 | (table $t0 30 30 funcref) |
326 | 326 | (table $t1 30 30 funcref) |
327 | | - |
| 327 | + |
328 | 328 | (elem (table $t1) (i32.const 2) func 3 1 4 1) |
329 | 329 | (elem funcref |
330 | 330 | (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8)) |
|
2147 | 2147 | (elem funcref) (elem funcref) (elem funcref) (elem funcref) |
2148 | 2148 | (elem funcref) |
2149 | 2149 | (func (table.init 64 (i32.const 0) (i32.const 0) (i32.const 0)))) |
| 2150 | + |
| 2151 | +;; Test that element segments are not re-evaluated on every `table.init`. |
| 2152 | +(module |
| 2153 | + (type $arr (array (mut arrayref))) |
| 2154 | + |
| 2155 | + (table $table 2 arrayref) |
| 2156 | + (elem $elem arrayref (item (array.new_default $arr (i32.const 0)))) |
| 2157 | + |
| 2158 | + (func (export "run") (result i32) |
| 2159 | + (table.init $table $elem (i32.const 0) (i32.const 0) (i32.const 1)) |
| 2160 | + (table.init $table $elem (i32.const 1) (i32.const 0) (i32.const 1)) |
| 2161 | + (ref.eq (table.get $table (i32.const 0)) |
| 2162 | + (table.get $table (i32.const 1))) |
| 2163 | + ) |
| 2164 | +) |
| 2165 | + |
| 2166 | +(assert_return (invoke "run") (i32.const 1)) |
0 commit comments