summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/precompute.txt28
-rw-r--r--test/passes/precompute.wast39
2 files changed, 67 insertions, 0 deletions
diff --git a/test/passes/precompute.txt b/test/passes/precompute.txt
index c0dd8df0a..74e4989dc 100644
--- a/test/passes/precompute.txt
+++ b/test/passes/precompute.txt
@@ -2,6 +2,7 @@
(type $0 (func (param i32)))
(type $1 (func (result i32)))
(type $2 (func))
+ (type $3 (func (result f64)))
(memory $0 0)
(func $x (type $0) (param $x i32)
(call $x
@@ -129,4 +130,31 @@
)
)
)
+ (func $reuse-br-value (type $3) (result f64)
+ (block $label$0 (result f64)
+ (i32.store8
+ (i32.const 1919623207)
+ (if (result i32)
+ (i32.const 1)
+ (block $label$2
+ (drop
+ (i64.and
+ (i64.trunc_u/f32
+ (f32.const 70847791997969805621592064)
+ )
+ (i64.const 729618461987467893)
+ )
+ )
+ (br $label$0
+ (f64.const 6.134856208230095e-154)
+ )
+ )
+ (i32.load offset=3 align=2
+ (i32.const 169901344)
+ )
+ )
+ )
+ (f64.const 4776014875438170098655851e156)
+ )
+ )
)
diff --git a/test/passes/precompute.wast b/test/passes/precompute.wast
index 84945f225..3eb2683bf 100644
--- a/test/passes/precompute.wast
+++ b/test/passes/precompute.wast
@@ -210,4 +210,43 @@
)
)
)
+ (func $reuse-br-value (result f64)
+ (block $label$0 (result f64)
+ (i32.store8
+ (i32.const 1919623207)
+ (if (result i32)
+ (i32.const 1)
+ (block $label$2 (result i32)
+ (drop
+ (i64.and
+ (i64.trunc_u/f32
+ (f32.const 70847791997969805621592064)
+ )
+ (i64.const 729618461987467893)
+ )
+ )
+ (br_if $label$2
+ (i32.const 2049535349)
+ (f32.eq
+ (f32.demote/f64
+ (f64.mul
+ (br_if $label$0 ;; this br is optimized, and br *and* values reused
+ (f64.const 6.134856208230095e-154)
+ (i32.const 690910817)
+ )
+ (f64.const 1.515470884183969e-152)
+ )
+ )
+ (f32.const 66524025679377434935296)
+ )
+ )
+ )
+ (i32.load offset=3 align=2
+ (i32.const 169901344)
+ )
+ )
+ )
+ (f64.const 4776014875438170098655851e156)
+ )
+ )
)