Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit e2e3383

Browse files
authored
Fix merge conflicts introduced w/ PRs #84 and #86 (#87)
Change the test generators to use `ref.func` and remove `passive`. At some point we'll want to remove the generators, but for let's try to maintain them.
1 parent 08be05a commit e2e3383

6 files changed

+63
-31
lines changed

test/core/memory_init.wast

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,21 +281,21 @@
281281

282282
(module
283283
(memory 1)
284-
(data passive "\37")
284+
(data "\37")
285285
(func (export "test")
286286
(memory.init 0 (i32.const 0x10001) (i32.const 0) (i32.const 0))))
287287
(assert_trap (invoke "test") "out of bounds")
288288

289289
(module
290290
(memory 1)
291-
(data passive "\37")
291+
(data "\37")
292292
(func (export "test")
293293
(memory.init 0 (i32.const 0x10000) (i32.const 0) (i32.const 0))))
294294
(invoke "test")
295295

296296
(module
297297
(memory 1)
298-
(data passive "\37")
298+
(data "\37")
299299
(func (export "test")
300300
(memory.init 0 (i32.const 0x10000) (i32.const 1) (i32.const 0))))
301301
(invoke "test")

test/core/table_copy.wast

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
;;
2+
;; Generated by ../meta/generate_table_copy.js
3+
;;
4+
15
(module
26
(func (export "ef0") (result i32) (i32.const 0))
37
(func (export "ef1") (result i32) (i32.const 1))
@@ -634,9 +638,11 @@
634638
(module
635639
(table 30 30 funcref)
636640
(elem (i32.const 2) 3 1 4 1)
637-
(elem passive funcref 2 7 1 8)
641+
(elem funcref
642+
(ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
638643
(elem (i32.const 12) 7 5 2 3 6)
639-
(elem passive funcref 5 9 2 7 6)
644+
(elem funcref
645+
(ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
640646
(func (result i32) (i32.const 0))
641647
(func (result i32) (i32.const 1))
642648
(func (result i32) (i32.const 2))
@@ -656,9 +662,11 @@
656662
(module
657663
(table 30 30 funcref)
658664
(elem (i32.const 2) 3 1 4 1)
659-
(elem passive funcref 2 7 1 8)
665+
(elem funcref
666+
(ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
660667
(elem (i32.const 12) 7 5 2 3 6)
661-
(elem passive funcref 5 9 2 7 6)
668+
(elem funcref
669+
(ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
662670
(func (result i32) (i32.const 0))
663671
(func (result i32) (i32.const 1))
664672
(func (result i32) (i32.const 2))
@@ -678,9 +686,11 @@
678686
(module
679687
(table 30 30 funcref)
680688
(elem (i32.const 2) 3 1 4 1)
681-
(elem passive funcref 2 7 1 8)
689+
(elem funcref
690+
(ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
682691
(elem (i32.const 12) 7 5 2 3 6)
683-
(elem passive funcref 5 9 2 7 6)
692+
(elem funcref
693+
(ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
684694
(func (result i32) (i32.const 0))
685695
(func (result i32) (i32.const 1))
686696
(func (result i32) (i32.const 2))

test/core/table_init.wast

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
;;
2+
;; Generated by ../meta/generate_table_init.js
3+
;;
4+
15
(module
26
(func (export "ef0") (result i32) (i32.const 0))
37
(func (export "ef1") (result i32) (i32.const 1))
@@ -447,9 +451,11 @@
447451
(module
448452
(table 30 30 funcref)
449453
(elem (i32.const 2) 3 1 4 1)
450-
(elem passive funcref 2 7 1 8)
454+
(elem funcref
455+
(ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
451456
(elem (i32.const 12) 7 5 2 3 6)
452-
(elem passive funcref 5 9 2 7 6)
457+
(elem funcref
458+
(ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
453459
(func (result i32) (i32.const 0))
454460
(func (result i32) (i32.const 1))
455461
(func (result i32) (i32.const 2))
@@ -468,9 +474,11 @@
468474
(module
469475
(table 30 30 funcref)
470476
(elem (i32.const 2) 3 1 4 1)
471-
(elem passive funcref 2 7 1 8)
477+
(elem funcref
478+
(ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
472479
(elem (i32.const 12) 7 5 2 3 6)
473-
(elem passive funcref 5 9 2 7 6)
480+
(elem funcref
481+
(ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
474482
(func (result i32) (i32.const 0))
475483
(func (result i32) (i32.const 1))
476484
(func (result i32) (i32.const 2))
@@ -489,9 +497,11 @@
489497
(module
490498
(table 30 30 funcref)
491499
(elem (i32.const 2) 3 1 4 1)
492-
(elem passive funcref 2 7 1 8)
500+
(elem funcref
501+
(ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
493502
(elem (i32.const 12) 7 5 2 3 6)
494-
(elem passive funcref 5 9 2 7 6)
503+
(elem funcref
504+
(ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
495505
(func (result i32) (i32.const 0))
496506
(func (result i32) (i32.const 1))
497507
(func (result i32) (i32.const 2))

test/meta/generate_memory_init.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ function mem_test(instruction, expected_result_vector) {
1111
(module
1212
(memory (export "memory0") 1 1)
1313
(data (i32.const 2) "\\03\\01\\04\\01")
14-
(data passive "\\02\\07\\01\\08")
14+
(data "\\02\\07\\01\\08")
1515
(data (i32.const 12) "\\07\\05\\02\\03\\06")
16-
(data passive "\\05\\09\\02\\07\\06")
16+
(data "\\05\\09\\02\\07\\06")
1717
(func (export "test")
1818
${instruction})
1919
(func (export "load8_u") (param i32) (result i32)
@@ -57,7 +57,7 @@ mem_test(`(memory.init 1 (i32.const 7) (i32.const 0) (i32.const 4))
5757

5858
let PREAMBLE =
5959
`(memory 1)
60-
(data passive "\\37")`;
60+
(data "\\37")`;
6161

6262
// drop with no memory
6363
print(
@@ -242,7 +242,7 @@ function mem_init(min, max, shared, backup, write) {
242242
print(
243243
`(module
244244
(memory ${min} ${max} ${shared})
245-
(data passive "\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42")
245+
(data "\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42")
246246
${checkRangeCode()}
247247
(func (export "run") (param $offs i32) (param $len i32)
248248
(memory.init 0 (local.get $offs) (i32.const 0) (local.get $len))))

test/meta/generate_table_copy.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ function emit_b(insn) {
3838
(import "a" "ef4" (func (result i32))) ;; index 4
3939
(table 30 30 funcref)
4040
(elem (i32.const 2) 3 1 4 1)
41-
(elem passive funcref 2 7 1 8)
41+
(elem funcref
42+
(ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
4243
(elem (i32.const 12) 7 5 2 3 6)
43-
(elem passive funcref 5 9 2 7 6)
44+
(elem funcref
45+
(ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
4446
(func (result i32) (i32.const 5)) ;; index 5
4547
(func (result i32) (i32.const 6))
4648
(func (result i32) (i32.const 7))
@@ -119,9 +121,11 @@ function do_test(insn1, insn2, errText)
119121
(module
120122
(table 30 30 funcref)
121123
(elem (i32.const 2) 3 1 4 1)
122-
(elem passive funcref 2 7 1 8)
124+
(elem funcref
125+
(ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
123126
(elem (i32.const 12) 7 5 2 3 6)
124-
(elem passive funcref 5 9 2 7 6)
127+
(elem funcref
128+
(ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
125129
(func (result i32) (i32.const 0))
126130
(func (result i32) (i32.const 1))
127131
(func (result i32) (i32.const 2))

test/meta/generate_table_init.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ function emit_b(insn) {
3838
(import "a" "ef4" (func (result i32))) ;; index 4
3939
(table 30 30 funcref)
4040
(elem (i32.const 2) 3 1 4 1)
41-
(elem passive funcref 2 7 1 8)
41+
(elem funcref
42+
(ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
4243
(elem (i32.const 12) 7 5 2 3 6)
43-
(elem passive funcref 5 9 2 7 6)
44+
(elem funcref
45+
(ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
4446
(func (result i32) (i32.const 5)) ;; index 5
4547
(func (result i32) (i32.const 6))
4648
(func (result i32) (i32.const 7))
@@ -121,7 +123,7 @@ print(
121123
print(
122124
`(assert_invalid
123125
(module
124-
(elem passive funcref 0)
126+
(elem funcref (ref.func 0))
125127
(func (result i32) (i32.const 0))
126128
(func (export "test")
127129
(elem.drop 4)))
@@ -132,7 +134,7 @@ print(
132134
print(
133135
`(assert_invalid
134136
(module
135-
(elem passive funcref 0)
137+
(elem funcref (ref.func 0))
136138
(func (result i32) (i32.const 0))
137139
(func (export "test")
138140
(table.init 4 (i32.const 12) (i32.const 1) (i32.const 1))))
@@ -145,9 +147,11 @@ function do_test(insn1, insn2, errText)
145147
(module
146148
(table 30 30 funcref)
147149
(elem (i32.const 2) 3 1 4 1)
148-
(elem passive funcref 2 7 1 8)
150+
(elem funcref
151+
(ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))
149152
(elem (i32.const 12) 7 5 2 3 6)
150-
(elem passive funcref 5 9 2 7 6)
153+
(elem funcref
154+
(ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))
151155
(func (result i32) (i32.const 0))
152156
(func (result i32) (i32.const 1))
153157
(func (result i32) (i32.const 2))
@@ -255,7 +259,7 @@ tab_test1("(table.init 1 (i32.const 30) (i32.const 4) (i32.const 0))",
255259
(assert_invalid
256260
(module
257261
(table 10 funcref)
258-
(elem passive funcref $f0 $f0 $f0)
262+
(elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))
259263
(func $f0)
260264
(func (export "test")
261265
(table.init 0 (${ty1}.const 1) (${ty2}.const 1) (${ty3}.const 1))))
@@ -278,7 +282,11 @@ function tbl_init(min, max, backup, write, segoffs=0) {
278282
(module
279283
(type (func (result i32)))
280284
(table ${min} ${max} funcref)
281-
(elem passive funcref $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7 $f8 $f9 $f10 $f11 $f12 $f13 $f14 $f15)
285+
(elem funcref
286+
(ref.func $f0) (ref.func $f1) (ref.func $f2) (ref.func $f3)
287+
(ref.func $f4) (ref.func $f5) (ref.func $f6) (ref.func $f7)
288+
(ref.func $f8) (ref.func $f9) (ref.func $f10) (ref.func $f11)
289+
(ref.func $f12) (ref.func $f13) (ref.func $f14) (ref.func $f15))
282290
(func $f0 (export "f0") (result i32) (i32.const 0))
283291
(func $f1 (export "f1") (result i32) (i32.const 1))
284292
(func $f2 (export "f2") (result i32) (i32.const 2))

0 commit comments

Comments
 (0)