summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNg Zhi An <ngzhian@gmail.com>2020-07-17 11:32:04 -0700
committerGitHub <noreply@github.com>2020-07-17 11:32:04 -0700
commite2a1f74acbf69e155914e86ccd3dc6a7a483fe3c (patch)
treec5328827b73bb3a0d018af1151de8ab36c9a593f /test
parent1c75f7de7e5f93373da34182a8729ace838ef7bd (diff)
downloadbinaryen-e2a1f74acbf69e155914e86ccd3dc6a7a483fe3c.tar.gz
binaryen-e2a1f74acbf69e155914e86ccd3dc6a7a483fe3c.tar.bz2
binaryen-e2a1f74acbf69e155914e86ccd3dc6a7a483fe3c.zip
Add v128 support to instrument locals (#2960)
In instrument-locals_all-features.wast I added the tests to the end of the file so that the diff of expected output is smaller and easier to read. Otherwise the constants will have to all change since they are order dependent.
Diffstat (limited to 'test')
-rw-r--r--test/passes/instrument-locals_all-features.txt18
-rw-r--r--test/passes/instrument-locals_all-features.wast6
2 files changed, 24 insertions, 0 deletions
diff --git a/test/passes/instrument-locals_all-features.txt b/test/passes/instrument-locals_all-features.txt
index 0676924da..e2ba3e107 100644
--- a/test/passes/instrument-locals_all-features.txt
+++ b/test/passes/instrument-locals_all-features.txt
@@ -3,6 +3,7 @@
(type $i32_i32_i64_=>_i64 (func (param i32 i32 i64) (result i64)))
(type $i32_i32_f32_=>_f32 (func (param i32 i32 f32) (result f32)))
(type $i32_i32_f64_=>_f64 (func (param i32 i32 f64) (result f64)))
+ (type $i32_i32_v128_=>_v128 (func (param i32 i32 v128) (result v128)))
(type $i32_i32_funcref_=>_funcref (func (param i32 i32 funcref) (result funcref)))
(type $i32_i32_externref_=>_externref (func (param i32 i32 externref) (result externref)))
(type $i32_i32_nullref_=>_nullref (func (param i32 i32 nullref) (result nullref)))
@@ -24,6 +25,8 @@
(import "env" "set_nullref" (func $set_nullref (param i32 i32 nullref) (result nullref)))
(import "env" "get_exnref" (func $get_exnref (param i32 i32 exnref) (result exnref)))
(import "env" "set_exnref" (func $set_exnref (param i32 i32 exnref) (result exnref)))
+ (import "env" "get_v128" (func $get_v128 (param i32 i32 v128) (result v128)))
+ (import "env" "set_v128" (func $set_v128 (param i32 i32 v128) (result v128)))
(func $test
(local $x i32)
(local $y i64)
@@ -33,6 +36,7 @@
(local $X externref)
(local $N nullref)
(local $E exnref)
+ (local $S v128)
(drop
(call $get_i32
(i32.const 0)
@@ -277,5 +281,19 @@
(local.set $E
(exnref.pop)
)
+ (drop
+ (call $get_v128
+ (i32.const 34)
+ (i32.const 8)
+ (local.get $S)
+ )
+ )
+ (local.set $S
+ (call $set_v128
+ (i32.const 35)
+ (i32.const 8)
+ (v128.const i32x4 0x00000000 0x00000001 0x00000002 0x00000003)
+ )
+ )
)
)
diff --git a/test/passes/instrument-locals_all-features.wast b/test/passes/instrument-locals_all-features.wast
index 1739fc352..5640b1661 100644
--- a/test/passes/instrument-locals_all-features.wast
+++ b/test/passes/instrument-locals_all-features.wast
@@ -8,6 +8,7 @@
(local $X externref)
(local $N nullref)
(local $E exnref)
+ (local $S v128)
(drop (local.get $x))
(drop (local.get $y))
@@ -50,6 +51,11 @@
(local.set $X (externref.pop))
(local.set $N (nullref.pop))
(local.set $E (exnref.pop))
+
+ ;; Add new instructions here so expected output doesn't change too much, it
+ ;; depends on order of instructions in this file.
+ (drop (local.get $S))
+ (local.set $S (v128.const i32x4 0x00000000 0x00000001 0x00000002 0x00000003))
)
)