summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-05-17 19:12:01 -0700
committerGitHub <noreply@github.com>2019-05-17 19:12:01 -0700
commit677808afb18a059d3dadcf2be7bd8daade5b77f9 (patch)
treea047c7c6070c47924587ad7c23aa6d53da23168d /test
parentd6a6188493031c5f6bbe2ca49860c9d9df962752 (diff)
downloadbinaryen-677808afb18a059d3dadcf2be7bd8daade5b77f9.tar.gz
binaryen-677808afb18a059d3dadcf2be7bd8daade5b77f9.tar.bz2
binaryen-677808afb18a059d3dadcf2be7bd8daade5b77f9.zip
Fix AvoidReinterprets on reinterpreted loads of fewer than the full size (#2123)
* fix * fix style
Diffstat (limited to 'test')
-rw-r--r--test/passes/avoid-reinterprets.txt15
-rw-r--r--test/passes/avoid-reinterprets.wast14
2 files changed, 29 insertions, 0 deletions
diff --git a/test/passes/avoid-reinterprets.txt b/test/passes/avoid-reinterprets.txt
index f78c6443b..294e1506f 100644
--- a/test/passes/avoid-reinterprets.txt
+++ b/test/passes/avoid-reinterprets.txt
@@ -1,5 +1,6 @@
(module
(type $0 (func))
+ (type $1 (func (result f32)))
(memory $0 1)
(func $simple (; 0 ;) (type $0)
(drop
@@ -148,4 +149,18 @@
(local.get $3)
)
)
+ (func $partial1 (; 6 ;) (type $1) (result f32)
+ (f32.reinterpret_i32
+ (i32.load16_u
+ (i32.const 3)
+ )
+ )
+ )
+ (func $partial2 (; 7 ;) (type $1) (result f32)
+ (f32.reinterpret_i32
+ (i32.load8_u
+ (i32.const 3)
+ )
+ )
+ )
)
diff --git a/test/passes/avoid-reinterprets.wast b/test/passes/avoid-reinterprets.wast
index 1499f8356..296b16df3 100644
--- a/test/passes/avoid-reinterprets.wast
+++ b/test/passes/avoid-reinterprets.wast
@@ -35,4 +35,18 @@
(local.set $y (local.get $x))
(drop (f32.reinterpret_i32 (local.get $y)))
)
+ (func $partial1 (result f32)
+ (f32.reinterpret_i32
+ (i32.load16_u
+ (i32.const 3)
+ )
+ )
+ )
+ (func $partial2 (result f32)
+ (f32.reinterpret_i32
+ (i32.load8_u
+ (i32.const 3)
+ )
+ )
+ )
)