Skip to content

Commit

Permalink
Update reference tests for wat changes (#2352)
Browse files Browse the repository at this point in the history
Spaces-in-names is now printed correctly!
  • Loading branch information
alexcrichton authored Nov 9, 2020
1 parent 3c0c2b3 commit 45d2f2d
Show file tree
Hide file tree
Showing 20 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/tests/interface-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down
6 changes: 3 additions & 3 deletions crates/cli/tests/reference/interface-types-anyref.wat
Original file line number Diff line number Diff line change
@@ -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)))
6 changes: 3 additions & 3 deletions crates/cli/tests/reference/interface-types-strings.wat
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions crates/externref-xform/tests/anyref-param-owned.wat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)))
;)
4 changes: 2 additions & 2 deletions crates/externref-xform/tests/anyref-param.wat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)))
;)
4 changes: 2 additions & 2 deletions crates/externref-xform/tests/clone-ref-intrinsic.wat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)))
;)
4 changes: 2 additions & 2 deletions crates/externref-xform/tests/drop-ref-intrinsic.wat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)))
;)
4 changes: 2 additions & 2 deletions crates/externref-xform/tests/import-anyref-owned.wat
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
(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
call $dealloc
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)))
Expand Down
4 changes: 2 additions & 2 deletions crates/externref-xform/tests/import-anyref-ret.wat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions crates/externref-xform/tests/import-anyref.wat
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
;)
4 changes: 2 additions & 2 deletions crates/externref-xform/tests/mixed-export.wat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)))
;)
4 changes: 2 additions & 2 deletions crates/externref-xform/tests/mixed.wat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)))
Expand Down
4 changes: 2 additions & 2 deletions crates/externref-xform/tests/ret-anyref.wat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)))
;)
4 changes: 2 additions & 2 deletions crates/externref-xform/tests/table-grow-intrinsic.wat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)))
;)
4 changes: 2 additions & 2 deletions crates/externref-xform/tests/table-set-null-intrinsic.wat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)))
;)
4 changes: 2 additions & 2 deletions crates/externref-xform/tests/table.wat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
;)
4 changes: 2 additions & 2 deletions crates/multi-value-xform/tests/align.wat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)))
;)
4 changes: 2 additions & 2 deletions crates/multi-value-xform/tests/many.wat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)))
;)
16 changes: 8 additions & 8 deletions crates/multi-value-xform/tests/simple.wat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)))
;)

0 comments on commit 45d2f2d

Please sign in to comment.