Skip to content

Update tests for a new wasmprinter release #2667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 (@name "externref_in_out externref shim") (type 0) (param externref externref) (result externref))
(func $#func0<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 $#func0<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 $#func0<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 (@name "strings multivalue shim") (type 2) (param i32 i32) (result i32 i32))
(func $#func3<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 $#func3<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 $#func3<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 (@name "foo externref shim") (type 2) (param externref)
(func $#func0<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 $#func0<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 (@name "foo externref shim") (type 1) (param externref)
(func $#func0<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 $#func0<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 (@name "foo externref shim") (type 3) (param externref) (result externref)
(func $#func0<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 $#func0<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 (@name "foo externref shim") (type 2) (param externref)
(func $#func0<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 $#func0<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 (@name "a externref shim") (type 1) (param i32)
(func $#func1<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 $#func1<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 (@name "a externref shim") (type 0) (result i32)
(func $#func1<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 $#func1<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 (@name "a externref shim") (type 1) (param i32)
(func $#func1<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 $#func1<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 (@name "a externref shim") (type 2) (param f32 externref i64 externref i32)
(func $#func0<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 $#func0<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 (@name "a externref shim") (type 2) (param f32 i32 i64 i32 i32)
(func $#func1<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 $#func1<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 (@name "foo externref shim") (type 1) (result externref)
(func $#func0<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 $#func0<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 @@ -25,7 +25,7 @@
local.get 1
table.grow 0
drop)
(func $foo_externref_shim (@name "foo externref shim") (type 2) (param externref)
(func $#func1<foo_externref_shim> (@name "foo externref shim") (type 2) (param externref)
(local i32)
call $alloc
local.tee 1
Expand All @@ -36,5 +36,5 @@
(func $alloc (type 0) (result i32)
i32.const 0)
(table (;0;) 32 externref)
(export "foo" (func $foo_externref_shim)))
(export "foo" (func $#func1<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 (@name "foo externref shim") (type 2) (param externref)
(func $#func0<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 $#func0<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 (@name "closure0 externref shim") (type 2) (param externref)
(func $#func0<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 $#func0<closure0_externref_shim>))
;)
4 changes: 2 additions & 2 deletions crates/externref-xform/tests/tee-before-grow.wat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
local.get 1
table.grow 0
drop)
(func $foo_externref_shim (@name "foo externref shim") (type 2) (param externref)
(func $#func1<foo_externref_shim> (@name "foo externref shim") (type 2) (param externref)
(local i32)
call $alloc
local.tee 1
Expand All @@ -39,5 +39,5 @@
(func $alloc (type 0) (result i32)
i32.const 0)
(table (;0;) 32 externref)
(export "foo" (func $foo_externref_shim)))
(export "foo" (func $#func1<foo_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 (@name "foo multivalue shim") (type 0) (result f64 i32 i64)
(func $#func0<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 $#func0<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 (@name "foo multivalue shim") (type 0) (result i32 f32 f64 i64)
(func $#func0<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 $#func0<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 (@name "i32 multivalue shim") (type 0) (result i32)
(func $#func0<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 (@name "i64 multivalue shim") (type 1) (result i64)
(func $#func1<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 (@name "f32 multivalue shim") (type 2) (result f32)
(func $#func2<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 (@name "f64 multivalue shim") (type 3) (result f64)
(func $#func3<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 $#func0<i32_multivalue_shim>))
(export "i64" (func $#func1<i64_multivalue_shim>))
(export "f32" (func $#func2<f32_multivalue_shim>))
(export "f64" (func $#func3<f64_multivalue_shim>)))
;)