summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/O_fast-math.txt14
-rw-r--r--test/passes/O_fast-math.wast12
-rw-r--r--test/passes/optimize-instructions_all-features.txt8
3 files changed, 30 insertions, 4 deletions
diff --git a/test/passes/O_fast-math.txt b/test/passes/O_fast-math.txt
index 1b454c68e..9aadd3d90 100644
--- a/test/passes/O_fast-math.txt
+++ b/test/passes/O_fast-math.txt
@@ -1,5 +1,7 @@
(module
(type $none_=>_f32 (func (result f32)))
+ (type $f32_=>_f32 (func (param f32) (result f32)))
+ (type $f64_=>_f64 (func (param f64) (result f64)))
(export "div" (func $0))
(export "mul1" (func $1))
(export "mul2" (func $2))
@@ -9,6 +11,8 @@
(export "add4" (func $2))
(export "sub1" (func $1))
(export "sub2" (func $2))
+ (export "mul_neg_one1" (func $9))
+ (export "mul_neg_one2" (func $10))
(func $0 (; has Stack IR ;) (result f32)
(f32.const -nan:0x23017a)
)
@@ -18,4 +22,14 @@
(func $2 (; has Stack IR ;) (result f32)
(f32.const -nan:0x74546d)
)
+ (func $9 (; has Stack IR ;) (param $0 f32) (result f32)
+ (f32.neg
+ (local.get $0)
+ )
+ )
+ (func $10 (; has Stack IR ;) (param $0 f64) (result f64)
+ (f64.neg
+ (local.get $0)
+ )
+ )
)
diff --git a/test/passes/O_fast-math.wast b/test/passes/O_fast-math.wast
index 2317f782d..ce2cd7b6e 100644
--- a/test/passes/O_fast-math.wast
+++ b/test/passes/O_fast-math.wast
@@ -54,4 +54,16 @@
(f32.const -0)
)
)
+ (func "mul_neg_one1" (param $x f32) (result f32)
+ (f32.mul
+ (local.get $x)
+ (f32.const -1)
+ )
+ )
+ (func "mul_neg_one2" (param $x f64) (result f64)
+ (f64.mul
+ (local.get $x)
+ (f64.const -1)
+ )
+ )
)
diff --git a/test/passes/optimize-instructions_all-features.txt b/test/passes/optimize-instructions_all-features.txt
index 272cce240..4d9c626fa 100644
--- a/test/passes/optimize-instructions_all-features.txt
+++ b/test/passes/optimize-instructions_all-features.txt
@@ -3829,15 +3829,15 @@
)
)
(drop
- (f32.sub
+ (f32.add
(local.get $fx)
- (f32.const -0)
+ (f32.const 0)
)
)
(drop
- (f64.sub
+ (f64.add
(local.get $fy)
- (f64.const -0)
+ (f64.const 0)
)
)
(drop