summaryrefslogtreecommitdiff
path: root/test/passes
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes')
-rw-r--r--test/passes/flatten_i64-to-i32-lowering.txt60
-rw-r--r--test/passes/flatten_i64-to-i32-lowering.wast10
2 files changed, 69 insertions, 1 deletions
diff --git a/test/passes/flatten_i64-to-i32-lowering.txt b/test/passes/flatten_i64-to-i32-lowering.txt
index 7d9ff6835..1db2481c8 100644
--- a/test/passes/flatten_i64-to-i32-lowering.txt
+++ b/test/passes/flatten_i64-to-i32-lowering.txt
@@ -206,7 +206,7 @@
(local $1 i32)
(local $1$hi i32)
(local $i64toi32_i32$0 i32)
- (block $label$1
+ (block
(unreachable)
(unreachable)
)
@@ -239,3 +239,61 @@
(nop)
)
)
+(module
+ (type $0 (func (param i32 i32)))
+ (type $1 (func))
+ (global $f (mut i32) (i32.const -1412567121))
+ (global $g (mut i32) (global.get $f))
+ (global $f$hi (mut i32) (i32.const 305419896))
+ (global $g$hi (mut i32) (global.get $f$hi))
+ (global $i64toi32_i32$HIGH_BITS (mut i32) (i32.const 0))
+ (export "exp" (func $1))
+ (func $call (; 0 ;) (type $0) (param $0 i32) (param $0$hi i32)
+ (nop)
+ )
+ (func $1 (; 1 ;) (type $1)
+ (local $0 i32)
+ (local $0$hi i32)
+ (local $i64toi32_i32$0 i32)
+ (block
+ (block
+ (local.set $0
+ (block (result i32)
+ (local.set $i64toi32_i32$0
+ (global.get $f$hi)
+ )
+ (global.get $f)
+ )
+ )
+ (local.set $0$hi
+ (local.get $i64toi32_i32$0)
+ )
+ )
+ (call $call
+ (block (result i32)
+ (local.set $i64toi32_i32$0
+ (local.get $0$hi)
+ )
+ (local.get $0)
+ )
+ (local.get $i64toi32_i32$0)
+ )
+ (nop)
+ (block
+ (global.set $f
+ (block (result i32)
+ (local.set $i64toi32_i32$0
+ (i32.const 287454020)
+ )
+ (i32.const 1432778632)
+ )
+ )
+ (global.set $f$hi
+ (local.get $i64toi32_i32$0)
+ )
+ )
+ (nop)
+ )
+ (nop)
+ )
+)
diff --git a/test/passes/flatten_i64-to-i32-lowering.wast b/test/passes/flatten_i64-to-i32-lowering.wast
index 29323d376..2f3bb37ca 100644
--- a/test/passes/flatten_i64-to-i32-lowering.wast
+++ b/test/passes/flatten_i64-to-i32-lowering.wast
@@ -41,3 +41,13 @@
)
)
)
+(module
+ (global $f (mut i64) (i64.const 0x12345678ABCDEFAF))
+ (global $g (mut i64) (global.get $f))
+ (func $call (param i64))
+ (func "exp"
+ (call $call (global.get $f))
+ (global.set $f (i64.const 0x1122334455667788))
+ )
+)
+