From 45d2f2df2d2a1424bc835e010073343c2d3b18c7 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 9 Nov 2020 10:52:37 -0600 Subject: [PATCH] Update reference tests for wat changes (#2352) Spaces-in-names is now printed correctly! --- azure-pipelines.yml | 2 +- crates/cli/tests/interface-types.rs | 2 +- .../tests/reference/interface-types-anyref.wat | 6 +++--- .../tests/reference/interface-types-strings.wat | 6 +++--- .../externref-xform/tests/anyref-param-owned.wat | 4 ++-- crates/externref-xform/tests/anyref-param.wat | 4 ++-- .../tests/clone-ref-intrinsic.wat | 4 ++-- .../externref-xform/tests/drop-ref-intrinsic.wat | 4 ++-- .../tests/import-anyref-owned.wat | 4 ++-- .../externref-xform/tests/import-anyref-ret.wat | 4 ++-- crates/externref-xform/tests/import-anyref.wat | 4 ++-- crates/externref-xform/tests/mixed-export.wat | 4 ++-- crates/externref-xform/tests/mixed.wat | 4 ++-- crates/externref-xform/tests/ret-anyref.wat | 4 ++-- .../tests/table-grow-intrinsic.wat | 4 ++-- .../tests/table-set-null-intrinsic.wat | 4 ++-- crates/externref-xform/tests/table.wat | 4 ++-- crates/multi-value-xform/tests/align.wat | 4 ++-- crates/multi-value-xform/tests/many.wat | 4 ++-- crates/multi-value-xform/tests/simple.wat | 16 ++++++++-------- 20 files changed, 46 insertions(+), 46 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e09bd2e39e7..3a97e813a65 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -99,7 +99,7 @@ jobs: displayName: "install wasm target" - task: NodeTool@0 inputs: - versionSpec: '>=13.0' + versionSpec: '>=15.0' - script: cargo test -p wasm-bindgen-cli-support displayName: "wasm-bindgen-cli-support tests" - script: cargo test -p wasm-bindgen-cli diff --git a/crates/cli/tests/interface-types.rs b/crates/cli/tests/interface-types.rs index 2e6ae294d42..471d0d4b323 100644 --- a/crates/cli/tests/interface-types.rs +++ b/crates/cli/tests/interface-types.rs @@ -56,7 +56,7 @@ fn runtest(test: &Path) -> Result<()> { exec( Command::new("node") - .arg("--experimental-wasm-anyref") + .arg("--experimental-wasm-reftypes") .arg("--experimental-wasm-mv") .arg(&js) .env("NODE_PATH", td.path()), diff --git a/crates/cli/tests/reference/interface-types-anyref.wat b/crates/cli/tests/reference/interface-types-anyref.wat index 2761dd98493..2e2aa6dc4a3 100644 --- a/crates/cli/tests/reference/interface-types-anyref.wat +++ b/crates/cli/tests/reference/interface-types-anyref.wat @@ -1,12 +1,12 @@ (module (type (;0;) (func (param externref externref) (result externref))) - (func $externref_in_out externref shim (type 0) (param externref externref) (result externref)) + (func $externref_in_out_externref_shim (@name "externref_in_out externref shim") (type 0) (param externref externref) (result externref)) (memory (;0;) 17) (export "memory" (memory 0)) - (export "externref_in_out" (func $externref_in_out externref shim)) + (export "externref_in_out" (func $externref_in_out_externref_shim)) (@interface type (;0;) (func (param externref) (param externref) (result externref))) (@interface func (;0;) (type 0) arg.get 0 arg.get 1 - call-core $externref_in_out externref shim) + call-core $externref_in_out_externref_shim) (@interface export "externref_in_out" (func 0))) diff --git a/crates/cli/tests/reference/interface-types-strings.wat b/crates/cli/tests/reference/interface-types-strings.wat index 24fb0b4c3ba..d554f205570 100644 --- a/crates/cli/tests/reference/interface-types-strings.wat +++ b/crates/cli/tests/reference/interface-types-strings.wat @@ -6,17 +6,17 @@ (func $__wbindgen_malloc (type 0) (param i32) (result i32)) (func $many_strings (type 3) (param i32 i32 i32 i32)) (func $__wbindgen_free (type 1) (param i32 i32)) - (func $strings multivalue shim (type 2) (param i32 i32) (result i32 i32)) + (func $strings_multivalue_shim (@name "strings multivalue shim") (type 2) (param i32 i32) (result i32 i32)) (memory (;0;) 17) (export "memory" (memory 0)) - (export "strings" (func $strings multivalue shim)) + (export "strings" (func $strings_multivalue_shim)) (export "many_strings" (func $many_strings)) (@interface type (;0;) (func (param string) (result string))) (@interface type (;1;) (func (param string) (param string))) (@interface func (;0;) (type 0) arg.get 0 string-to-memory $__wbindgen_malloc - call-core $strings multivalue shim + call-core $strings_multivalue_shim defer-call-core $__wbindgen_free memory-to-string) (@interface func (;1;) (type 1) diff --git a/crates/externref-xform/tests/anyref-param-owned.wat b/crates/externref-xform/tests/anyref-param-owned.wat index b5649a72003..0fd8eceba96 100644 --- a/crates/externref-xform/tests/anyref-param-owned.wat +++ b/crates/externref-xform/tests/anyref-param-owned.wat @@ -12,7 +12,7 @@ (type (;0;) (func (result i32))) (type (;1;) (func (param i32))) (type (;2;) (func (param externref))) - (func $foo externref shim (type 2) (param externref) + (func $foo_externref_shim (@name "foo externref shim") (type 2) (param externref) (local i32) call $alloc local.tee 1 @@ -24,5 +24,5 @@ i32.const 0) (func $foo (type 1) (param i32)) (table (;0;) 32 externref) - (export "foo" (func $foo externref shim))) + (export "foo" (func $foo_externref_shim))) ;) diff --git a/crates/externref-xform/tests/anyref-param.wat b/crates/externref-xform/tests/anyref-param.wat index 5b1b23b49bb..cc9a5c5163c 100644 --- a/crates/externref-xform/tests/anyref-param.wat +++ b/crates/externref-xform/tests/anyref-param.wat @@ -11,7 +11,7 @@ (module (type (;0;) (func (param i32))) (type (;1;) (func (param externref))) - (func $foo externref shim (type 1) (param externref) + (func $foo_externref_shim (@name "foo externref shim") (type 1) (param externref) (local i32) global.get 0 i32.const 1 @@ -33,5 +33,5 @@ (func $foo (type 0) (param i32)) (table (;0;) 32 externref) (global (;0;) (mut i32) (i32.const 32)) - (export "foo" (func $foo externref shim))) + (export "foo" (func $foo_externref_shim))) ;) diff --git a/crates/externref-xform/tests/clone-ref-intrinsic.wat b/crates/externref-xform/tests/clone-ref-intrinsic.wat index 401befcd25d..639099d387b 100644 --- a/crates/externref-xform/tests/clone-ref-intrinsic.wat +++ b/crates/externref-xform/tests/clone-ref-intrinsic.wat @@ -17,7 +17,7 @@ (type (;1;) (func (param i32))) (type (;2;) (func (param i32) (result i32))) (type (;3;) (func (param externref) (result externref))) - (func $foo externref shim (type 3) (param externref) (result externref) + (func $foo_externref_shim (@name "foo externref shim") (type 3) (param externref) (result externref) (local i32) call $alloc local.tee 1 @@ -44,5 +44,5 @@ i32.const 0) (func $dealloc (type 1) (param i32)) (table (;0;) 32 externref) - (export "foo" (func $foo externref shim))) + (export "foo" (func $foo_externref_shim))) ;) diff --git a/crates/externref-xform/tests/drop-ref-intrinsic.wat b/crates/externref-xform/tests/drop-ref-intrinsic.wat index fec08c6c828..be2cef568ae 100644 --- a/crates/externref-xform/tests/drop-ref-intrinsic.wat +++ b/crates/externref-xform/tests/drop-ref-intrinsic.wat @@ -16,7 +16,7 @@ (type (;0;) (func (result i32))) (type (;1;) (func (param i32))) (type (;2;) (func (param externref))) - (func $foo externref shim (type 2) (param externref) + (func $foo_externref_shim (@name "foo externref shim") (type 2) (param externref) (local i32) call $alloc local.tee 1 @@ -31,5 +31,5 @@ i32.const 0) (func $dealloc (type 1) (param i32)) (table (;0;) 32 externref) - (export "foo" (func $foo externref shim))) + (export "foo" (func $foo_externref_shim))) ;) diff --git a/crates/externref-xform/tests/import-anyref-owned.wat b/crates/externref-xform/tests/import-anyref-owned.wat index 8bb18e1cb52..72c5b5ba65c 100644 --- a/crates/externref-xform/tests/import-anyref-owned.wat +++ b/crates/externref-xform/tests/import-anyref-owned.wat @@ -16,7 +16,7 @@ (type (;1;) (func (param i32))) (type (;2;) (func (param externref))) (import "" "a" (func $a (type 2))) - (func $a externref shim (type 1) (param i32) + (func $a_externref_shim (@name "a externref shim") (type 1) (param i32) local.get 0 table.get 0 local.get 0 @@ -24,7 +24,7 @@ call $a) (func (;2;) (type 0) i32.const 0 - call $a externref shim) + call $a_externref_shim) (func $dealloc (type 1) (param i32)) (table (;0;) 32 externref) (export "foo" (func 2))) diff --git a/crates/externref-xform/tests/import-anyref-ret.wat b/crates/externref-xform/tests/import-anyref-ret.wat index 09f2cec65cf..cc396d833e7 100644 --- a/crates/externref-xform/tests/import-anyref-ret.wat +++ b/crates/externref-xform/tests/import-anyref-ret.wat @@ -14,7 +14,7 @@ (type (;0;) (func (result i32))) (type (;1;) (func (result externref))) (import "" "a" (func $a (type 1))) - (func $a externref shim (type 0) (result i32) + (func $a_externref_shim (@name "a externref shim") (type 0) (result i32) (local i32 externref) call $a local.set 1 @@ -24,7 +24,7 @@ table.set 0 local.get 0) (func (;2;) (type 0) (result i32) - call $a externref shim) + call $a_externref_shim) (func $alloc (type 0) (result i32) i32.const 0) (table (;0;) 32 externref) diff --git a/crates/externref-xform/tests/import-anyref.wat b/crates/externref-xform/tests/import-anyref.wat index 3da24454cd4..f1188e08f0f 100644 --- a/crates/externref-xform/tests/import-anyref.wat +++ b/crates/externref-xform/tests/import-anyref.wat @@ -16,13 +16,13 @@ (type (;1;) (func (param i32))) (type (;2;) (func (param externref))) (import "" "a" (func $a (type 2))) - (func $a externref shim (type 1) (param i32) + (func $a_externref_shim (@name "a externref shim") (type 1) (param i32) local.get 0 table.get 0 call $a) (func (;2;) (type 0) i32.const 0 - call $a externref shim) + call $a_externref_shim) (table (;0;) 32 externref) (export "foo" (func 2))) ;) diff --git a/crates/externref-xform/tests/mixed-export.wat b/crates/externref-xform/tests/mixed-export.wat index 784877f36a0..5f800608314 100644 --- a/crates/externref-xform/tests/mixed-export.wat +++ b/crates/externref-xform/tests/mixed-export.wat @@ -12,7 +12,7 @@ (type (;0;) (func (result i32))) (type (;1;) (func (param f32 i32 i64 i32 i32))) (type (;2;) (func (param f32 externref i64 externref i32))) - (func $a externref shim (type 2) (param f32 externref i64 externref i32) + (func $a_externref_shim (@name "a externref shim") (type 2) (param f32 externref i64 externref i32) (local i32 i32) global.get 0 i32.const 1 @@ -44,5 +44,5 @@ (func $a (type 1) (param f32 i32 i64 i32 i32)) (table (;0;) 32 externref) (global (;0;) (mut i32) (i32.const 32)) - (export "a" (func $a externref shim))) + (export "a" (func $a_externref_shim))) ;) diff --git a/crates/externref-xform/tests/mixed.wat b/crates/externref-xform/tests/mixed.wat index 499a08fc7ab..da5e7d0ba3b 100644 --- a/crates/externref-xform/tests/mixed.wat +++ b/crates/externref-xform/tests/mixed.wat @@ -21,7 +21,7 @@ (type (;2;) (func (param f32 i32 i64 i32 i32))) (type (;3;) (func (param f32 externref i64 externref i32))) (import "" "a" (func $a (type 3))) - (func $a externref shim (type 2) (param f32 i32 i64 i32 i32) + (func $a_externref_shim (@name "a externref shim") (type 2) (param f32 i32 i64 i32 i32) local.get 0 local.get 1 table.get 0 @@ -38,7 +38,7 @@ i64.const 3 i32.const 4 i32.const 5 - call $a externref shim) + call $a_externref_shim) (func $dealloc (type 1) (param i32)) (table (;0;) 32 externref) (export "foo" (func 2))) diff --git a/crates/externref-xform/tests/ret-anyref.wat b/crates/externref-xform/tests/ret-anyref.wat index f223b059906..dfa36482b52 100644 --- a/crates/externref-xform/tests/ret-anyref.wat +++ b/crates/externref-xform/tests/ret-anyref.wat @@ -14,7 +14,7 @@ (type (;0;) (func (result i32))) (type (;1;) (func (result externref))) (type (;2;) (func (param i32))) - (func $foo externref shim (type 1) (result externref) + (func $foo_externref_shim (@name "foo externref shim") (type 1) (result externref) (local i32) call $foo local.tee 0 @@ -25,5 +25,5 @@ i32.const 0) (func $dealloc (type 2) (param i32)) (table (;0;) 32 externref) - (export "foo" (func $foo externref shim))) + (export "foo" (func $foo_externref_shim))) ;) diff --git a/crates/externref-xform/tests/table-grow-intrinsic.wat b/crates/externref-xform/tests/table-grow-intrinsic.wat index 0010e8caea3..5886a0b5178 100644 --- a/crates/externref-xform/tests/table-grow-intrinsic.wat +++ b/crates/externref-xform/tests/table-grow-intrinsic.wat @@ -17,7 +17,7 @@ (type (;0;) (func (result i32))) (type (;1;) (func (param i32))) (type (;2;) (func (param externref))) - (func $foo externref shim (type 2) (param externref) + (func $foo_externref_shim (@name "foo externref shim") (type 2) (param externref) (local i32) call $alloc local.tee 1 @@ -33,5 +33,5 @@ (func $alloc (type 0) (result i32) i32.const 0) (table (;0;) 32 externref) - (export "foo" (func $foo externref shim))) + (export "foo" (func $foo_externref_shim))) ;) diff --git a/crates/externref-xform/tests/table-set-null-intrinsic.wat b/crates/externref-xform/tests/table-set-null-intrinsic.wat index 40ba1a6d5cd..eb9bdf82be4 100644 --- a/crates/externref-xform/tests/table-set-null-intrinsic.wat +++ b/crates/externref-xform/tests/table-set-null-intrinsic.wat @@ -16,7 +16,7 @@ (type (;0;) (func (result i32))) (type (;1;) (func (param i32))) (type (;2;) (func (param externref))) - (func $foo externref shim (type 2) (param externref) + (func $foo_externref_shim (@name "foo externref shim") (type 2) (param externref) (local i32) call $alloc local.tee 1 @@ -31,5 +31,5 @@ (func $alloc (type 0) (result i32) i32.const 0) (table (;0;) 32 externref) - (export "foo" (func $foo externref shim))) + (export "foo" (func $foo_externref_shim))) ;) diff --git a/crates/externref-xform/tests/table.wat b/crates/externref-xform/tests/table.wat index 0186c50949e..60a9cf238ed 100644 --- a/crates/externref-xform/tests/table.wat +++ b/crates/externref-xform/tests/table.wat @@ -14,7 +14,7 @@ (type (;0;) (func (result i32))) (type (;1;) (func (param i32))) (type (;2;) (func (param externref))) - (func $closure0 externref shim (type 2) (param externref) + (func $closure0_externref_shim (@name "closure0 externref shim") (type 2) (param externref) (local i32) call $alloc local.tee 1 @@ -29,5 +29,5 @@ (table (;1;) 32 externref) (export "func" (table 0)) (elem (;0;) (i32.const 0) func $foo) - (elem (;1;) (i32.const 1) func $closure0 externref shim)) + (elem (;1;) (i32.const 1) func $closure0_externref_shim)) ;) diff --git a/crates/multi-value-xform/tests/align.wat b/crates/multi-value-xform/tests/align.wat index 384d31da82f..e2f1cabe5f9 100644 --- a/crates/multi-value-xform/tests/align.wat +++ b/crates/multi-value-xform/tests/align.wat @@ -11,7 +11,7 @@ (module (type (;0;) (func (result f64 i32 i64))) (type (;1;) (func (param i32))) - (func $foo multivalue shim (type 0) (result f64 i32 i64) + (func $foo_multivalue_shim (@name "foo multivalue shim") (type 0) (result f64 i32 i64) (local i32) global.get 0 i32.const 32 @@ -33,5 +33,5 @@ (func $foo (type 1) (param i32)) (memory (;0;) 1) (global (;0;) (mut i32) (i32.const 0)) - (export "foo" (func $foo multivalue shim))) + (export "foo" (func $foo_multivalue_shim))) ;) diff --git a/crates/multi-value-xform/tests/many.wat b/crates/multi-value-xform/tests/many.wat index ea48d8aebab..2fc8402f9da 100644 --- a/crates/multi-value-xform/tests/many.wat +++ b/crates/multi-value-xform/tests/many.wat @@ -11,7 +11,7 @@ (module (type (;0;) (func (result i32 f32 f64 i64))) (type (;1;) (func (param i32))) - (func $foo multivalue shim (type 0) (result i32 f32 f64 i64) + (func $foo_multivalue_shim (@name "foo multivalue shim") (type 0) (result i32 f32 f64 i64) (local i32) global.get 0 i32.const 32 @@ -35,5 +35,5 @@ (func $foo (type 1) (param i32)) (memory (;0;) 1) (global (;0;) (mut i32) (i32.const 0)) - (export "foo" (func $foo multivalue shim))) + (export "foo" (func $foo_multivalue_shim))) ;) diff --git a/crates/multi-value-xform/tests/simple.wat b/crates/multi-value-xform/tests/simple.wat index c1ebc23ddbf..56a5886874e 100644 --- a/crates/multi-value-xform/tests/simple.wat +++ b/crates/multi-value-xform/tests/simple.wat @@ -20,7 +20,7 @@ (type (;2;) (func (result f32))) (type (;3;) (func (result f64))) (type (;4;) (func (param i32))) - (func $i32 multivalue shim (type 0) (result i32) + (func $i32_multivalue_shim (@name "i32 multivalue shim") (type 0) (result i32) (local i32) global.get 0 i32.const 16 @@ -35,7 +35,7 @@ i32.const 16 i32.add global.set 0) - (func $i64 multivalue shim (type 1) (result i64) + (func $i64_multivalue_shim (@name "i64 multivalue shim") (type 1) (result i64) (local i32) global.get 0 i32.const 16 @@ -50,7 +50,7 @@ i32.const 16 i32.add global.set 0) - (func $f32 multivalue shim (type 2) (result f32) + (func $f32_multivalue_shim (@name "f32 multivalue shim") (type 2) (result f32) (local i32) global.get 0 i32.const 16 @@ -65,7 +65,7 @@ i32.const 16 i32.add global.set 0) - (func $f64 multivalue shim (type 3) (result f64) + (func $f64_multivalue_shim (@name "f64 multivalue shim") (type 3) (result f64) (local i32) global.get 0 i32.const 16 @@ -86,8 +86,8 @@ (func $f64 (type 4) (param i32)) (memory (;0;) 1) (global (;0;) (mut i32) (i32.const 0)) - (export "i32" (func $i32 multivalue shim)) - (export "i64" (func $i64 multivalue shim)) - (export "f32" (func $f32 multivalue shim)) - (export "f64" (func $f64 multivalue shim))) + (export "i32" (func $i32_multivalue_shim)) + (export "i64" (func $i64_multivalue_shim)) + (export "f32" (func $f32_multivalue_shim)) + (export "f64" (func $f64_multivalue_shim))) ;)