From 3e7946ab1c482439fc9abe68c998948c1740f98c Mon Sep 17 00:00:00 2001 From: Alexey Date: Wed, 1 Aug 2018 13:48:38 +0300 Subject: [PATCH] fix call_indirect test (#98) Merged --- src/optimizer.rs | 2 +- tests/expectations/stack-height/global.wat | 3 +-- tests/expectations/stack-height/imports.wat | 3 +-- tests/expectations/stack-height/simple.wat | 3 +-- tests/expectations/stack-height/table.wat | 9 +++------ 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/optimizer.rs b/src/optimizer.rs index 3a2f9d6..0a66ded 100644 --- a/src/optimizer.rs +++ b/src/optimizer.rs @@ -558,7 +558,7 @@ mod tests { .signature().param().i32().param().i32().build() .build() .function() - .signature().param().i32().param().i32().build() + .signature().param().i32().param().i32().param().i32().build() .build() .function() .signature().param().i32().build() diff --git a/tests/expectations/stack-height/global.wat b/tests/expectations/stack-height/global.wat index f0f3e00..bca81eb 100644 --- a/tests/expectations/stack-height/global.wat +++ b/tests/expectations/stack-height/global.wat @@ -2,7 +2,6 @@ (type (;0;) (func)) (type (;1;) (func (param i32 i32) (result i32))) (type (;2;) (func (param i32))) - (type (;3;) (func (param i32 i32) (result i32))) (import "env" "foo" (func (;0;) (type 0))) (func (;1;) (type 1) (param i32 i32) (result i32) get_local 0 @@ -33,7 +32,7 @@ i32.sub set_global 1 drop) - (func (;3;) (type 3) (param i32 i32) (result i32) + (func (;3;) (type 1) (param i32 i32) (result i32) get_local 0 get_local 1 get_global 1 diff --git a/tests/expectations/stack-height/imports.wat b/tests/expectations/stack-height/imports.wat index ee14b2a..52ce258 100644 --- a/tests/expectations/stack-height/imports.wat +++ b/tests/expectations/stack-height/imports.wat @@ -1,7 +1,6 @@ (module (type (;0;) (func)) (type (;1;) (func (param i32 i32) (result i32))) - (type (;2;) (func (param i32 i32) (result i32))) (import "env" "foo" (func (;0;) (type 0))) (import "env" "boo" (func (;1;) (type 0))) (func (;2;) (type 1) (param i32 i32) (result i32) @@ -10,7 +9,7 @@ get_local 0 get_local 1 i32.add) - (func (;3;) (type 2) (param i32 i32) (result i32) + (func (;3;) (type 1) (param i32 i32) (result i32) get_local 0 get_local 1 get_global 0 diff --git a/tests/expectations/stack-height/simple.wat b/tests/expectations/stack-height/simple.wat index 4a6c324..2d65ba5 100644 --- a/tests/expectations/stack-height/simple.wat +++ b/tests/expectations/stack-height/simple.wat @@ -1,10 +1,9 @@ (module (type (;0;) (func)) - (type (;1;) (func)) (func (;0;) (type 0) i32.const 123 drop) - (func (;1;) (type 1) + (func (;1;) (type 0) get_global 0 i32.const 1 i32.add diff --git a/tests/expectations/stack-height/table.wat b/tests/expectations/stack-height/table.wat index f2d4f2c..2927d9a 100644 --- a/tests/expectations/stack-height/table.wat +++ b/tests/expectations/stack-height/table.wat @@ -2,9 +2,6 @@ (type (;0;) (func)) (type (;1;) (func (param i32))) (type (;2;) (func (param i32 i32) (result i32))) - (type (;3;) (func (param i32 i32) (result i32))) - (type (;4;) (func (param i32))) - (type (;5;) (func (param i32 i32) (result i32))) (import "env" "foo" (func (;0;) (type 0))) (func (;1;) (type 1) (param i32) get_local 0 @@ -29,7 +26,7 @@ get_local 0 get_local 1 i32.add) - (func (;3;) (type 3) (param i32 i32) (result i32) + (func (;3;) (type 2) (param i32 i32) (result i32) get_local 0 get_local 1 get_global 0 @@ -47,7 +44,7 @@ i32.const 2 i32.sub set_global 0) - (func (;4;) (type 4) (param i32) + (func (;4;) (type 1) (param i32) get_local 0 get_global 0 i32.const 2 @@ -64,7 +61,7 @@ i32.const 2 i32.sub set_global 0) - (func (;5;) (type 5) (param i32 i32) (result i32) + (func (;5;) (type 2) (param i32 i32) (result i32) get_local 0 get_local 1 get_global 0