summaryrefslogtreecommitdiff
path: root/test/passes/post-emscripten.wast
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2020-11-06 20:07:08 -0800
committerGitHub <noreply@github.com>2020-11-06 20:07:08 -0800
commitc8249b553f89ede0b4dedd6c00fe7f9f7e745de2 (patch)
tree71b3c97a7aec40a89c839743fa2f0b4d6185fa35 /test/passes/post-emscripten.wast
parent040a7cc3721292669609cc8020bd11ad6930d321 (diff)
downloadbinaryen-c8249b553f89ede0b4dedd6c00fe7f9f7e745de2.tar.gz
binaryen-c8249b553f89ede0b4dedd6c00fe7f9f7e745de2.tar.bz2
binaryen-c8249b553f89ede0b4dedd6c00fe7f9f7e745de2.zip
Remove OptimizeCalls from PostEmscripten. NFC. (#3326)
We no longer build modules that import `global.Math`.
Diffstat (limited to 'test/passes/post-emscripten.wast')
-rw-r--r--test/passes/post-emscripten.wast75
1 files changed, 6 insertions, 69 deletions
diff --git a/test/passes/post-emscripten.wast b/test/passes/post-emscripten.wast
index e5a4637cc..99fa3b57b 100644
--- a/test/passes/post-emscripten.wast
+++ b/test/passes/post-emscripten.wast
@@ -1,83 +1,28 @@
(module
(type $0 (func (param i32)))
- (import "global.Math" "pow" (func $Math_pow (param f64 f64) (result f64)))
(import "env" "invoke_vif" (func $invoke_vif (param i32 i32 f32)))
(memory 256 256)
(table 7 7 funcref)
- (elem (i32.const 0) $pow2 $pow.2 $exc $other_safe $other_unsafe $deep_safe $deep_unsafe)
- (func $pow2
- (local $x f64)
- (local $y f64)
- (drop
- (call $Math_pow
- (f64.const 1)
- (f64.const 2)
- )
- )
- (drop
- (call $Math_pow
- (f64.const 1)
- (f64.const 3)
- )
- )
- (drop
- (call $Math_pow
- (f64.const 2)
- (f64.const 1)
- )
- )
- (local.set $x (f64.const 5))
- (drop
- (call $Math_pow
- (local.get $x)
- (f64.const 2)
- )
- )
- (drop
- (call $Math_pow
- (local.tee $y (f64.const 7))
- (f64.const 2)
- )
- )
- (drop
- (call $Math_pow
- (f64.const 8)
- (f64.const 2)
- )
- )
- )
- (func $pow.2
- (drop
- (call $Math_pow
- (f64.const 1)
- (f64.const 0.5)
- )
- )
- (drop
- (call $Math_pow
- (f64.const 1)
- (f64.const 0.51)
- )
- )
- )
+ (elem (i32.const 0) $f1 $exc $other_safe $other_unsafe $deep_safe $deep_unsafe)
+ (func $f1)
(func $exc
(call $invoke_vif
- (i32.const 3) ;; other_safe()
+ (i32.const 2) ;; other_safe()
(i32.const 42)
(f32.const 3.14159)
)
(call $invoke_vif
- (i32.const 4) ;; other_unsafe()
+ (i32.const 3) ;; other_unsafe()
(i32.const 55)
(f32.const 2.18281828)
)
(call $invoke_vif
- (i32.const 5) ;; deep_safe()
+ (i32.const 4) ;; deep_safe()
(i32.const 100)
(f32.const 1.111)
)
(call $invoke_vif
- (i32.const 6) ;; deep_unsafe()
+ (i32.const 5) ;; deep_unsafe()
(i32.const 999)
(f32.const 1.414)
)
@@ -90,12 +35,6 @@
(func $other_safe (param i32) (param f32)
)
(func $other_unsafe (param i32) (param f32)
- (drop
- (call $Math_pow
- (f64.const 1)
- (f64.const 3)
- )
- )
)
(func $deep_safe (param i32) (param f32)
(call $other_safe (unreachable) (unreachable))
@@ -111,7 +50,6 @@
)
(module ;; non-constant base for elem
(type $0 (func (param i32)))
- (import "global.Math" "pow" (func $Math_pow (param f64 f64) (result f64)))
(import "env" "invoke_vif" (func $invoke_vif (param i32 i32 f32)))
(import "env" "glob" (global $glob i32)) ;; non-constant table offset
(memory 256 256)
@@ -129,7 +67,6 @@
)
(module ;; indirect call in the invoke target, which we assume might throw
(type $none_=>_none (func))
- (import "global.Math" "pow" (func $Math_pow (param f64 f64) (result f64)))
(import "env" "invoke_vif" (func $invoke_vif (param i32 i32 f32)))
(import "env" "glob" (global $glob i32)) ;; non-constant table offset
(memory 256 256)