From e2e3383a13150ac8432d3d0b392ca33b93dd81d4 Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Mon, 13 May 2019 12:11:26 -0700 Subject: [PATCH] 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. --- test/core/memory_init.wast | 6 +++--- test/core/table_copy.wast | 22 ++++++++++++++++------ test/core/table_init.wast | 22 ++++++++++++++++------ test/meta/generate_memory_init.js | 8 ++++---- test/meta/generate_table_copy.js | 12 ++++++++---- test/meta/generate_table_init.js | 24 ++++++++++++++++-------- 6 files changed, 63 insertions(+), 31 deletions(-) diff --git a/test/core/memory_init.wast b/test/core/memory_init.wast index fb432a3d..ee2ed36e 100644 --- a/test/core/memory_init.wast +++ b/test/core/memory_init.wast @@ -281,21 +281,21 @@ (module (memory 1) - (data passive "\37") + (data "\37") (func (export "test") (memory.init 0 (i32.const 0x10001) (i32.const 0) (i32.const 0)))) (assert_trap (invoke "test") "out of bounds") (module (memory 1) - (data passive "\37") + (data "\37") (func (export "test") (memory.init 0 (i32.const 0x10000) (i32.const 0) (i32.const 0)))) (invoke "test") (module (memory 1) - (data passive "\37") + (data "\37") (func (export "test") (memory.init 0 (i32.const 0x10000) (i32.const 1) (i32.const 0)))) (invoke "test") diff --git a/test/core/table_copy.wast b/test/core/table_copy.wast index d8e66426..a68c9c78 100644 --- a/test/core/table_copy.wast +++ b/test/core/table_copy.wast @@ -1,3 +1,7 @@ +;; +;; Generated by ../meta/generate_table_copy.js +;; + (module (func (export "ef0") (result i32) (i32.const 0)) (func (export "ef1") (result i32) (i32.const 1)) @@ -634,9 +638,11 @@ (module (table 30 30 funcref) (elem (i32.const 2) 3 1 4 1) - (elem passive funcref 2 7 1 8) + (elem funcref + (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8)) (elem (i32.const 12) 7 5 2 3 6) - (elem passive funcref 5 9 2 7 6) + (elem funcref + (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6)) (func (result i32) (i32.const 0)) (func (result i32) (i32.const 1)) (func (result i32) (i32.const 2)) @@ -656,9 +662,11 @@ (module (table 30 30 funcref) (elem (i32.const 2) 3 1 4 1) - (elem passive funcref 2 7 1 8) + (elem funcref + (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8)) (elem (i32.const 12) 7 5 2 3 6) - (elem passive funcref 5 9 2 7 6) + (elem funcref + (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6)) (func (result i32) (i32.const 0)) (func (result i32) (i32.const 1)) (func (result i32) (i32.const 2)) @@ -678,9 +686,11 @@ (module (table 30 30 funcref) (elem (i32.const 2) 3 1 4 1) - (elem passive funcref 2 7 1 8) + (elem funcref + (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8)) (elem (i32.const 12) 7 5 2 3 6) - (elem passive funcref 5 9 2 7 6) + (elem funcref + (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6)) (func (result i32) (i32.const 0)) (func (result i32) (i32.const 1)) (func (result i32) (i32.const 2)) diff --git a/test/core/table_init.wast b/test/core/table_init.wast index 5e80a0a8..36834d28 100644 --- a/test/core/table_init.wast +++ b/test/core/table_init.wast @@ -1,3 +1,7 @@ +;; +;; Generated by ../meta/generate_table_init.js +;; + (module (func (export "ef0") (result i32) (i32.const 0)) (func (export "ef1") (result i32) (i32.const 1)) @@ -447,9 +451,11 @@ (module (table 30 30 funcref) (elem (i32.const 2) 3 1 4 1) - (elem passive funcref 2 7 1 8) + (elem funcref + (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8)) (elem (i32.const 12) 7 5 2 3 6) - (elem passive funcref 5 9 2 7 6) + (elem funcref + (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6)) (func (result i32) (i32.const 0)) (func (result i32) (i32.const 1)) (func (result i32) (i32.const 2)) @@ -468,9 +474,11 @@ (module (table 30 30 funcref) (elem (i32.const 2) 3 1 4 1) - (elem passive funcref 2 7 1 8) + (elem funcref + (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8)) (elem (i32.const 12) 7 5 2 3 6) - (elem passive funcref 5 9 2 7 6) + (elem funcref + (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6)) (func (result i32) (i32.const 0)) (func (result i32) (i32.const 1)) (func (result i32) (i32.const 2)) @@ -489,9 +497,11 @@ (module (table 30 30 funcref) (elem (i32.const 2) 3 1 4 1) - (elem passive funcref 2 7 1 8) + (elem funcref + (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8)) (elem (i32.const 12) 7 5 2 3 6) - (elem passive funcref 5 9 2 7 6) + (elem funcref + (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6)) (func (result i32) (i32.const 0)) (func (result i32) (i32.const 1)) (func (result i32) (i32.const 2)) diff --git a/test/meta/generate_memory_init.js b/test/meta/generate_memory_init.js index ab6c7699..c157d7d2 100644 --- a/test/meta/generate_memory_init.js +++ b/test/meta/generate_memory_init.js @@ -11,9 +11,9 @@ function mem_test(instruction, expected_result_vector) { (module (memory (export "memory0") 1 1) (data (i32.const 2) "\\03\\01\\04\\01") - (data passive "\\02\\07\\01\\08") + (data "\\02\\07\\01\\08") (data (i32.const 12) "\\07\\05\\02\\03\\06") - (data passive "\\05\\09\\02\\07\\06") + (data "\\05\\09\\02\\07\\06") (func (export "test") ${instruction}) (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)) let PREAMBLE = `(memory 1) - (data passive "\\37")`; + (data "\\37")`; // drop with no memory print( @@ -242,7 +242,7 @@ function mem_init(min, max, shared, backup, write) { print( `(module (memory ${min} ${max} ${shared}) - (data passive "\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42") + (data "\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42") ${checkRangeCode()} (func (export "run") (param $offs i32) (param $len i32) (memory.init 0 (local.get $offs) (i32.const 0) (local.get $len)))) diff --git a/test/meta/generate_table_copy.js b/test/meta/generate_table_copy.js index e91d1d1e..ba2636c4 100644 --- a/test/meta/generate_table_copy.js +++ b/test/meta/generate_table_copy.js @@ -38,9 +38,11 @@ function emit_b(insn) { (import "a" "ef4" (func (result i32))) ;; index 4 (table 30 30 funcref) (elem (i32.const 2) 3 1 4 1) - (elem passive funcref 2 7 1 8) + (elem funcref + (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8)) (elem (i32.const 12) 7 5 2 3 6) - (elem passive funcref 5 9 2 7 6) + (elem funcref + (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6)) (func (result i32) (i32.const 5)) ;; index 5 (func (result i32) (i32.const 6)) (func (result i32) (i32.const 7)) @@ -119,9 +121,11 @@ function do_test(insn1, insn2, errText) (module (table 30 30 funcref) (elem (i32.const 2) 3 1 4 1) - (elem passive funcref 2 7 1 8) + (elem funcref + (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8)) (elem (i32.const 12) 7 5 2 3 6) - (elem passive funcref 5 9 2 7 6) + (elem funcref + (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6)) (func (result i32) (i32.const 0)) (func (result i32) (i32.const 1)) (func (result i32) (i32.const 2)) diff --git a/test/meta/generate_table_init.js b/test/meta/generate_table_init.js index 2ce82c21..436dc1e7 100644 --- a/test/meta/generate_table_init.js +++ b/test/meta/generate_table_init.js @@ -38,9 +38,11 @@ function emit_b(insn) { (import "a" "ef4" (func (result i32))) ;; index 4 (table 30 30 funcref) (elem (i32.const 2) 3 1 4 1) - (elem passive funcref 2 7 1 8) + (elem funcref + (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8)) (elem (i32.const 12) 7 5 2 3 6) - (elem passive funcref 5 9 2 7 6) + (elem funcref + (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6)) (func (result i32) (i32.const 5)) ;; index 5 (func (result i32) (i32.const 6)) (func (result i32) (i32.const 7)) @@ -121,7 +123,7 @@ print( print( `(assert_invalid (module - (elem passive funcref 0) + (elem funcref (ref.func 0)) (func (result i32) (i32.const 0)) (func (export "test") (elem.drop 4))) @@ -132,7 +134,7 @@ print( print( `(assert_invalid (module - (elem passive funcref 0) + (elem funcref (ref.func 0)) (func (result i32) (i32.const 0)) (func (export "test") (table.init 4 (i32.const 12) (i32.const 1) (i32.const 1)))) @@ -145,9 +147,11 @@ function do_test(insn1, insn2, errText) (module (table 30 30 funcref) (elem (i32.const 2) 3 1 4 1) - (elem passive funcref 2 7 1 8) + (elem funcref + (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8)) (elem (i32.const 12) 7 5 2 3 6) - (elem passive funcref 5 9 2 7 6) + (elem funcref + (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6)) (func (result i32) (i32.const 0)) (func (result i32) (i32.const 1)) (func (result i32) (i32.const 2)) @@ -255,7 +259,7 @@ tab_test1("(table.init 1 (i32.const 30) (i32.const 4) (i32.const 0))", (assert_invalid (module (table 10 funcref) - (elem passive funcref $f0 $f0 $f0) + (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0)) (func $f0) (func (export "test") (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) { (module (type (func (result i32))) (table ${min} ${max} funcref) - (elem passive funcref $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7 $f8 $f9 $f10 $f11 $f12 $f13 $f14 $f15) + (elem funcref + (ref.func $f0) (ref.func $f1) (ref.func $f2) (ref.func $f3) + (ref.func $f4) (ref.func $f5) (ref.func $f6) (ref.func $f7) + (ref.func $f8) (ref.func $f9) (ref.func $f10) (ref.func $f11) + (ref.func $f12) (ref.func $f13) (ref.func $f14) (ref.func $f15)) (func $f0 (export "f0") (result i32) (i32.const 0)) (func $f1 (export "f1") (result i32) (i32.const 1)) (func $f2 (export "f2") (result i32) (i32.const 2))