summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-08-28 18:15:33 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-09-07 09:55:58 -0700
commitd58adf43956c65615c9cd8d6c2f4c2a3cceff8bb (patch)
treeec30ccb497799ff31d68ac76dc0b485f55fd24a9 /test
parentfd0160dafa25699404c1603adfcf965c75115854 (diff)
downloadbinaryen-d58adf43956c65615c9cd8d6c2f4c2a3cceff8bb.tar.gz
binaryen-d58adf43956c65615c9cd8d6c2f4c2a3cceff8bb.tar.bz2
binaryen-d58adf43956c65615c9cd8d6c2f4c2a3cceff8bb.zip
support HEAP8[x | 0| notation in asm2wasm
Diffstat (limited to 'test')
-rw-r--r--test/unit.asm.js5
-rw-r--r--test/unit.fromasm5
-rw-r--r--test/unit.fromasm.imprecise5
-rw-r--r--test/unit.fromasm.imprecise.no-opts7
-rw-r--r--test/unit.fromasm.no-opts7
5 files changed, 29 insertions, 0 deletions
diff --git a/test/unit.asm.js b/test/unit.asm.js
index 8f0812e29..25aed0834 100644
--- a/test/unit.asm.js
+++ b/test/unit.asm.js
@@ -319,6 +319,11 @@ function asm(global, env, buffer) {
return 0;
}
+ function heap8NoShift(x) {
+ x = x | 0;
+ return HEAP8[x | 0] | 0;
+ }
+
function z() {
}
function w() {
diff --git a/test/unit.fromasm b/test/unit.fromasm
index 0260adb81..98202a4ec 100644
--- a/test/unit.fromasm
+++ b/test/unit.fromasm
@@ -575,4 +575,9 @@
)
(i32.const 0)
)
+ (func $heap8NoShift (param $0 i32) (result i32)
+ (i32.load8_s
+ (get_local $0)
+ )
+ )
)
diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise
index 5ebe88c6f..493ebb67e 100644
--- a/test/unit.fromasm.imprecise
+++ b/test/unit.fromasm.imprecise
@@ -556,4 +556,9 @@
)
(i32.const 0)
)
+ (func $heap8NoShift (param $0 i32) (result i32)
+ (i32.load8_s
+ (get_local $0)
+ )
+ )
)
diff --git a/test/unit.fromasm.imprecise.no-opts b/test/unit.fromasm.imprecise.no-opts
index 7fdd01aaa..89a448a82 100644
--- a/test/unit.fromasm.imprecise.no-opts
+++ b/test/unit.fromasm.imprecise.no-opts
@@ -956,6 +956,13 @@
(i32.const 0)
)
)
+ (func $heap8NoShift (param $x i32) (result i32)
+ (return
+ (i32.load8_s
+ (get_local $x)
+ )
+ )
+ )
(func $z
(nop)
)
diff --git a/test/unit.fromasm.no-opts b/test/unit.fromasm.no-opts
index 14c4d6615..f1253c849 100644
--- a/test/unit.fromasm.no-opts
+++ b/test/unit.fromasm.no-opts
@@ -962,6 +962,13 @@
(i32.const 0)
)
)
+ (func $heap8NoShift (param $x i32) (result i32)
+ (return
+ (i32.load8_s
+ (get_local $x)
+ )
+ )
+ )
(func $z
(nop)
)