summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2021-10-04 08:40:11 -0700
committerGitHub <noreply@github.com>2021-10-04 08:40:11 -0700
commite43f0ffb2469bf3dc1ca74d6bb1f1ad2d04142a1 (patch)
tree8b28b1ff3b66af200a0f3ebc31014fdab789f47a
parentd92d8683fea10145d89186db08204016778a7675 (diff)
downloadbinaryen-e43f0ffb2469bf3dc1ca74d6bb1f1ad2d04142a1.tar.gz
binaryen-e43f0ffb2469bf3dc1ca74d6bb1f1ad2d04142a1.tar.bz2
binaryen-e43f0ffb2469bf3dc1ca74d6bb1f1ad2d04142a1.zip
Port a batch of passes tests to lit (#4202)
- fpcast-emu.wast - generate-dyncalls_all-features.wast - generaite-i64-dyncalls.wast - instrument-locals_all-features_disable-typed-function-references.wast - instrument-memory.wast - instrument-memory64.wast
-rw-r--r--test/lit/passes/fpcast-emu.wast408
-rw-r--r--test/lit/passes/generate-dyncalls_all-features.wast105
-rw-r--r--test/lit/passes/generate-i64-dyncalls.wast39
-rw-r--r--test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast302
-rw-r--r--test/lit/passes/instrument-memory.wast679
-rw-r--r--test/lit/passes/instrument-memory64.wast679
-rw-r--r--test/passes/fpcast-emu.txt312
-rw-r--r--test/passes/fpcast-emu.wast80
-rw-r--r--test/passes/generate-dyncalls_all-features.txt64
-rw-r--r--test/passes/generate-dyncalls_all-features.wast19
-rw-r--r--test/passes/generate-i64-dyncalls.txt20
-rw-r--r--test/passes/generate-i64-dyncalls.wast10
-rw-r--r--test/passes/instrument-locals_all-features_disable-typed-function-references.txt220
-rw-r--r--test/passes/instrument-locals_all-features_disable-typed-function-references.wast44
-rw-r--r--test/passes/instrument-memory.txt603
-rw-r--r--test/passes/instrument-memory.wast57
-rw-r--r--test/passes/instrument-memory64.passes1
-rw-r--r--test/passes/instrument-memory64.txt603
-rw-r--r--test/passes/instrument-memory64.wast57
19 files changed, 2212 insertions, 2090 deletions
diff --git a/test/lit/passes/fpcast-emu.wast b/test/lit/passes/fpcast-emu.wast
new file mode 100644
index 000000000..8c4fb72b3
--- /dev/null
+++ b/test/lit/passes/fpcast-emu.wast
@@ -0,0 +1,408 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+;; NOTE: This test was ported using port_test.py and could be cleaned up.
+
+;; RUN: foreach %s %t wasm-opt --fpcast-emu -S -o - | filecheck %s
+
+(module
+ ;; CHECK: (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64 (func (param i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64) (result i64)))
+
+ ;; CHECK: (type $i32_i64_f32_f64_=>_f32 (func (param i32 i64 f32 f64) (result f32)))
+
+ ;; CHECK: (type $vijfd (func (param i32 i64 f32 f64)))
+ (type $vijfd (func (param i32) (param i64) (param f32) (param f64)))
+ ;; CHECK: (type $jii (func (param i32 i32) (result i64)))
+ (type $jii (func (param i32) (param i32) (result i64)))
+ ;; CHECK: (type $fjj (func (param i64 i64) (result f32)))
+ (type $fjj (func (param i64) (param i64) (result f32)))
+ ;; CHECK: (type $dff (func (param f32 f32) (result f64)))
+ (type $dff (func (param f32) (param f32) (result f64)))
+ ;; CHECK: (type $idd (func (param f64 f64) (result i32)))
+ (type $idd (func (param f64) (param f64) (result i32)))
+ ;; CHECK: (import "env" "imported_func" (func $imported-func (param i32 i64 f32 f64) (result f32)))
+ (import "env" "imported_func" (func $imported-func (param i32 i64 f32 f64) (result f32)))
+ (table 10 10 funcref)
+ (elem (i32.const 0) $a $b $c $d $e $e $imported-func)
+ ;; CHECK: (table $0 10 10 funcref)
+
+ ;; CHECK: (elem (i32.const 0) $byn$fpcast-emu$a $byn$fpcast-emu$b $byn$fpcast-emu$c $byn$fpcast-emu$d $byn$fpcast-emu$e $byn$fpcast-emu$e $byn$fpcast-emu$imported-func)
+
+ ;; CHECK: (func $a (param $x i32) (param $y i64) (param $z f32) (param $w f64)
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call_indirect (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64)
+ ;; CHECK-NEXT: (i64.extend_i32_u
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.const 2)
+ ;; CHECK-NEXT: (i64.extend_i32_u
+ ;; CHECK-NEXT: (i32.reinterpret_f32
+ ;; CHECK-NEXT: (f32.const 3)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.reinterpret_f64
+ ;; CHECK-NEXT: (f64.const 4)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i32.const 1337)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $a (param $x i32) (param $y i64) (param $z f32) (param $w f64)
+ (call_indirect (type $vijfd)
+ (i32.const 1)
+ (i64.const 2)
+ (f32.const 3)
+ (f64.const 4)
+ (i32.const 1337)
+ )
+ )
+ ;; CHECK: (func $b (param $x i32) (param $y i32) (result i64)
+ ;; CHECK-NEXT: (call_indirect (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64)
+ ;; CHECK-NEXT: (i64.extend_i32_u
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.extend_i32_u
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i32.const 1337)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $b (param $x i32) (param $y i32) (result i64)
+ (call_indirect (type $jii)
+ (i32.const 1)
+ (i32.const 2)
+ (i32.const 1337)
+ )
+ )
+ ;; CHECK: (func $c (param $x i64) (param $y i64) (result f32)
+ ;; CHECK-NEXT: (f32.reinterpret_i32
+ ;; CHECK-NEXT: (i32.wrap_i64
+ ;; CHECK-NEXT: (call_indirect (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64)
+ ;; CHECK-NEXT: (i64.const 1)
+ ;; CHECK-NEXT: (i64.const 2)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i32.const 1337)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $c (param $x i64) (param $y i64) (result f32)
+ (call_indirect (type $fjj)
+ (i64.const 1)
+ (i64.const 2)
+ (i32.const 1337)
+ )
+ )
+ ;; CHECK: (func $d (param $x f32) (param $y f32) (result f64)
+ ;; CHECK-NEXT: (f64.reinterpret_i64
+ ;; CHECK-NEXT: (call_indirect (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64)
+ ;; CHECK-NEXT: (i64.extend_i32_u
+ ;; CHECK-NEXT: (i32.reinterpret_f32
+ ;; CHECK-NEXT: (f32.const 1)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.extend_i32_u
+ ;; CHECK-NEXT: (i32.reinterpret_f32
+ ;; CHECK-NEXT: (f32.const 2)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i32.const 1337)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $d (param $x f32) (param $y f32) (result f64)
+ (call_indirect (type $dff)
+ (f32.const 1)
+ (f32.const 2)
+ (i32.const 1337)
+ )
+ )
+ ;; CHECK: (func $e (param $x f64) (param $y f64) (result i32)
+ ;; CHECK-NEXT: (i32.wrap_i64
+ ;; CHECK-NEXT: (call_indirect (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64)
+ ;; CHECK-NEXT: (i64.reinterpret_f64
+ ;; CHECK-NEXT: (f64.const 1)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.reinterpret_f64
+ ;; CHECK-NEXT: (f64.const 2)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i32.const 1337)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $e (param $x f64) (param $y f64) (result i32)
+ (call_indirect (type $idd)
+ (f64.const 1)
+ (f64.const 2)
+ (i32.const 1337)
+ )
+ )
+)
+;; CHECK: (func $byn$fpcast-emu$a (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i64) (param $6 i64) (param $7 i64) (param $8 i64) (param $9 i64) (param $10 i64) (param $11 i64) (param $12 i64) (param $13 i64) (param $14 i64) (param $15 i64) (result i64)
+;; CHECK-NEXT: (call $a
+;; CHECK-NEXT: (i32.wrap_i64
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (local.get $1)
+;; CHECK-NEXT: (f32.reinterpret_i32
+;; CHECK-NEXT: (i32.wrap_i64
+;; CHECK-NEXT: (local.get $2)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (f64.reinterpret_i64
+;; CHECK-NEXT: (local.get $3)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (i64.const 0)
+;; CHECK-NEXT: )
+
+;; CHECK: (func $byn$fpcast-emu$b (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i64) (param $6 i64) (param $7 i64) (param $8 i64) (param $9 i64) (param $10 i64) (param $11 i64) (param $12 i64) (param $13 i64) (param $14 i64) (param $15 i64) (result i64)
+;; CHECK-NEXT: (call $b
+;; CHECK-NEXT: (i32.wrap_i64
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (i32.wrap_i64
+;; CHECK-NEXT: (local.get $1)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+
+;; CHECK: (func $byn$fpcast-emu$c (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i64) (param $6 i64) (param $7 i64) (param $8 i64) (param $9 i64) (param $10 i64) (param $11 i64) (param $12 i64) (param $13 i64) (param $14 i64) (param $15 i64) (result i64)
+;; CHECK-NEXT: (i64.extend_i32_u
+;; CHECK-NEXT: (i32.reinterpret_f32
+;; CHECK-NEXT: (call $c
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: (local.get $1)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+
+;; CHECK: (func $byn$fpcast-emu$d (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i64) (param $6 i64) (param $7 i64) (param $8 i64) (param $9 i64) (param $10 i64) (param $11 i64) (param $12 i64) (param $13 i64) (param $14 i64) (param $15 i64) (result i64)
+;; CHECK-NEXT: (i64.reinterpret_f64
+;; CHECK-NEXT: (call $d
+;; CHECK-NEXT: (f32.reinterpret_i32
+;; CHECK-NEXT: (i32.wrap_i64
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (f32.reinterpret_i32
+;; CHECK-NEXT: (i32.wrap_i64
+;; CHECK-NEXT: (local.get $1)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+
+;; CHECK: (func $byn$fpcast-emu$e (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i64) (param $6 i64) (param $7 i64) (param $8 i64) (param $9 i64) (param $10 i64) (param $11 i64) (param $12 i64) (param $13 i64) (param $14 i64) (param $15 i64) (result i64)
+;; CHECK-NEXT: (i64.extend_i32_u
+;; CHECK-NEXT: (call $e
+;; CHECK-NEXT: (f64.reinterpret_i64
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (f64.reinterpret_i64
+;; CHECK-NEXT: (local.get $1)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+
+;; CHECK: (func $byn$fpcast-emu$imported-func (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i64) (param $6 i64) (param $7 i64) (param $8 i64) (param $9 i64) (param $10 i64) (param $11 i64) (param $12 i64) (param $13 i64) (param $14 i64) (param $15 i64) (result i64)
+;; CHECK-NEXT: (i64.extend_i32_u
+;; CHECK-NEXT: (i32.reinterpret_f32
+;; CHECK-NEXT: (call $imported-func
+;; CHECK-NEXT: (i32.wrap_i64
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (local.get $1)
+;; CHECK-NEXT: (f32.reinterpret_i32
+;; CHECK-NEXT: (i32.wrap_i64
+;; CHECK-NEXT: (local.get $2)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (f64.reinterpret_i64
+;; CHECK-NEXT: (local.get $3)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+(module
+ (type $0 (func (param i64)))
+ ;; CHECK: (type $1 (func (param f32) (result i64)))
+ (type $1 (func (param f32) (result i64)))
+ ;; CHECK: (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64 (func (param i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64) (result i64)))
+
+ ;; CHECK: (global $global$0 (mut i32) (i32.const 10))
+ (global $global$0 (mut i32) (i32.const 10))
+ (table 42 42 funcref)
+ ;; CHECK: (table $0 42 42 funcref)
+
+ ;; CHECK: (export "func_106" (func $0))
+ (export "func_106" (func $0))
+ ;; CHECK: (func $0 (param $0 f32) (result i64)
+ ;; CHECK-NEXT: (block $label$1 (result i64)
+ ;; CHECK-NEXT: (loop $label$2
+ ;; CHECK-NEXT: (global.set $global$0
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call_indirect (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64)
+ ;; CHECK-NEXT: (br $label$1
+ ;; CHECK-NEXT: (i64.const 4294967295)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i32.const 18)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $0 (; 0 ;) (type $1) (param $0 f32) (result i64)
+ (block $label$1 (result i64)
+ (loop $label$2
+ (global.set $global$0
+ (i32.const 0)
+ )
+ (call_indirect (type $0)
+ (br $label$1
+ (i64.const 4294967295)
+ )
+ (i32.const 18)
+ )
+ )
+ )
+ )
+)
+(module
+ (table 42 42 funcref)
+ (elem (i32.const 0) $a $b)
+ ;; CHECK: (type $f32_=>_none (func (param f32)))
+
+ ;; CHECK: (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64 (func (param i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64) (result i64)))
+
+ ;; CHECK: (type $f64_=>_none (func (param f64)))
+
+ ;; CHECK: (table $0 42 42 funcref)
+
+ ;; CHECK: (elem (i32.const 0) $byn$fpcast-emu$a $byn$fpcast-emu$b)
+
+ ;; CHECK: (export "dynCall_vf" (func $dynCall_vf))
+ (export "dynCall_vf" (func $dynCall_vf))
+ ;; CHECK: (export "dynCall_vd" (func $min_vd))
+ (export "dynCall_vd" (func $min_vd))
+ ;; CHECK: (func $a (param $0 f32)
+ ;; CHECK-NEXT: (nop)
+ ;; CHECK-NEXT: )
+ (func $a (param $0 f32))
+ ;; CHECK: (func $b (param $0 f64)
+ ;; CHECK-NEXT: (nop)
+ ;; CHECK-NEXT: )
+ (func $b (param $0 f64))
+ ;; CHECK: (func $dynCall_vf (param $0 f32)
+ ;; CHECK-NEXT: (nop)
+ ;; CHECK-NEXT: )
+ (func $dynCall_vf (param $0 f32))
+ ;; CHECK: (func $min_vd (param $0 f32)
+ ;; CHECK-NEXT: (nop)
+ ;; CHECK-NEXT: )
+ (func $min_vd (param $0 f32))
+)
+
+;; CHECK: (func $byn$fpcast-emu$a (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i64) (param $6 i64) (param $7 i64) (param $8 i64) (param $9 i64) (param $10 i64) (param $11 i64) (param $12 i64) (param $13 i64) (param $14 i64) (param $15 i64) (result i64)
+;; CHECK-NEXT: (call $a
+;; CHECK-NEXT: (f32.reinterpret_i32
+;; CHECK-NEXT: (i32.wrap_i64
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (i64.const 0)
+;; CHECK-NEXT: )
+
+;; CHECK: (func $byn$fpcast-emu$b (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i64) (param $6 i64) (param $7 i64) (param $8 i64) (param $9 i64) (param $10 i64) (param $11 i64) (param $12 i64) (param $13 i64) (param $14 i64) (param $15 i64) (result i64)
+;; CHECK-NEXT: (call $b
+;; CHECK-NEXT: (f64.reinterpret_i64
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+;; CHECK-NEXT: (i64.const 0)
+;; CHECK-NEXT: )
diff --git a/test/lit/passes/generate-dyncalls_all-features.wast b/test/lit/passes/generate-dyncalls_all-features.wast
new file mode 100644
index 000000000..a234d121d
--- /dev/null
+++ b/test/lit/passes/generate-dyncalls_all-features.wast
@@ -0,0 +1,105 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+;; NOTE: This test was ported using port_test.py and could be cleaned up.
+
+;; RUN: foreach %s %t wasm-opt --generate-dyncalls --all-features -S -o - | filecheck %s
+
+(module
+ ;; CHECK: (type $i32_i32_i32_=>_none (func (param i32 i32 i32)))
+
+ ;; CHECK: (type $none_=>_i32 (func (result i32)))
+
+ ;; CHECK: (type $i32_=>_i64 (func (param i32) (result i64)))
+
+ ;; CHECK: (type $i32_=>_i32 (func (param i32) (result i32)))
+
+ ;; CHECK: (type $i32_i32_=>_i64 (func (param i32 i32) (result i64)))
+
+ ;; CHECK: (type $i32_i32_=>_none (func (param i32 i32)))
+
+ ;; CHECK: (import "env" "invoke_vii" (func $invoke_vii (param i32 i32 i32)))
+ (import "env" "invoke_vii" (func $invoke_vii (param i32 i32 i32)))
+ ;; CHECK: (table $0 2 2 funcref)
+
+ ;; CHECK: (elem (i32.const 0) $f1 $f2)
+
+ ;; CHECK: (export "dynCall_i" (func $dynCall_i))
+
+ ;; CHECK: (export "dynCall_ji" (func $dynCall_ji))
+
+ ;; CHECK: (export "dynCall_vii" (func $dynCall_vii))
+
+ ;; CHECK: (func $f1 (result i32)
+ ;; CHECK-NEXT: (i32.const 1024)
+ ;; CHECK-NEXT: )
+ (func $f1 (result i32)
+ (i32.const 1024)
+ )
+ ;; CHECK: (func $f2 (param $0 i32) (result i64)
+ ;; CHECK-NEXT: (i64.const 42)
+ ;; CHECK-NEXT: )
+ (func $f2 (param i32) (result i64)
+ (i64.const 42)
+ )
+ (table 2 2 funcref)
+ (elem (i32.const 0) $f1 $f2)
+)
+;; CHECK: (func $dynCall_i (param $fptr i32) (result i32)
+;; CHECK-NEXT: (call_indirect $0 (type $none_=>_i32)
+;; CHECK-NEXT: (local.get $fptr)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+
+;; CHECK: (func $dynCall_ji (param $fptr i32) (param $0 i32) (result i64)
+;; CHECK-NEXT: (call_indirect $0 (type $i32_=>_i64)
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: (local.get $fptr)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+
+;; CHECK: (func $dynCall_vii (param $fptr i32) (param $0 i32) (param $1 i32)
+;; CHECK-NEXT: (call_indirect $0 (type $i32_i32_=>_none)
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: (local.get $1)
+;; CHECK-NEXT: (local.get $fptr)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+(module
+ ;; CHECK: (type $i32_i32_i32_=>_none (func (param i32 i32 i32)))
+
+ ;; CHECK: (type $none_=>_i32 (func (result i32)))
+
+ ;; CHECK: (type $i32_=>_i32 (func (param i32) (result i32)))
+
+ ;; CHECK: (type $i32_i32_=>_none (func (param i32 i32)))
+
+ ;; CHECK: (import "env" "table" (table $timport$0 1 1 funcref))
+ (import "env" "invoke_vii" (func $invoke_vii (param i32 i32 i32)))
+ ;; CHECK: (import "env" "invoke_vii" (func $invoke_vii (param i32 i32 i32)))
+ (import "env" "table" (table 1 1 funcref))
+ (elem (i32.const 0) $f)
+ ;; CHECK: (elem (i32.const 0) $f)
+
+ ;; CHECK: (export "dynCall_i" (func $dynCall_i))
+
+ ;; CHECK: (export "dynCall_vii" (func $dynCall_vii))
+
+ ;; CHECK: (func $f (result i32)
+ ;; CHECK-NEXT: (i32.const 42)
+ ;; CHECK-NEXT: )
+ (func $f (result i32)
+ (i32.const 42)
+ )
+)
+;; CHECK: (func $dynCall_i (param $fptr i32) (result i32)
+;; CHECK-NEXT: (call_indirect $timport$0 (type $none_=>_i32)
+;; CHECK-NEXT: (local.get $fptr)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+
+;; CHECK: (func $dynCall_vii (param $fptr i32) (param $0 i32) (param $1 i32)
+;; CHECK-NEXT: (call_indirect $timport$0 (type $i32_i32_=>_none)
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: (local.get $1)
+;; CHECK-NEXT: (local.get $fptr)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
diff --git a/test/lit/passes/generate-i64-dyncalls.wast b/test/lit/passes/generate-i64-dyncalls.wast
new file mode 100644
index 000000000..80f873c3c
--- /dev/null
+++ b/test/lit/passes/generate-i64-dyncalls.wast
@@ -0,0 +1,39 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+;; NOTE: This test was ported using port_test.py and could be cleaned up.
+
+;; RUN: foreach %s %t wasm-opt --generate-i64-dyncalls -S -o - | filecheck %s
+
+(module
+ ;; CHECK: (type $i32_=>_i64 (func (param i32) (result i64)))
+
+ ;; CHECK: (type $none_=>_i32 (func (result i32)))
+
+ ;; CHECK: (type $i32_i32_=>_i64 (func (param i32 i32) (result i64)))
+
+ ;; CHECK: (table $0 2 2 funcref)
+
+ ;; CHECK: (elem (i32.const 0) $f1 $f2)
+
+ ;; CHECK: (export "dynCall_ji" (func $dynCall_ji))
+
+ ;; CHECK: (func $f1 (result i32)
+ ;; CHECK-NEXT: (i32.const 1024)
+ ;; CHECK-NEXT: )
+ (func $f1 (result i32)
+ (i32.const 1024)
+ )
+ ;; CHECK: (func $f2 (param $0 i32) (result i64)
+ ;; CHECK-NEXT: (i64.const 42)
+ ;; CHECK-NEXT: )
+ (func $f2 (param i32) (result i64)
+ (i64.const 42)
+ )
+ (table 2 2 funcref)
+ (elem (i32.const 0) $f1 $f2)
+)
+;; CHECK: (func $dynCall_ji (param $fptr i32) (param $0 i32) (result i64)
+;; CHECK-NEXT: (call_indirect (type $i32_=>_i64)
+;; CHECK-NEXT: (local.get $0)
+;; CHECK-NEXT: (local.get $fptr)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
diff --git a/test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast b/test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast
new file mode 100644
index 000000000..8b971cdb8
--- /dev/null
+++ b/test/lit/passes/instrument-locals_all-features_disable-typed-function-references.wast
@@ -0,0 +1,302 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+;; NOTE: This test was ported using port_test.py and could be cleaned up.
+
+;; RUN: foreach %s %t wasm-opt --instrument-locals --all-features --disable-typed-function-references -S -o - | filecheck %s
+
+(module
+ ;; CHECK: (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
+
+ ;; CHECK: (type $i32_i32_i64_=>_i64 (func (param i32 i32 i64) (result i64)))
+
+ ;; CHECK: (type $i32_i32_f32_=>_f32 (func (param i32 i32 f32) (result f32)))
+
+ ;; CHECK: (type $i32_i32_f64_=>_f64 (func (param i32 i32 f64) (result f64)))
+
+ ;; CHECK: (type $i32_i32_funcref_=>_funcref (func (param i32 i32 funcref) (result funcref)))
+
+ ;; CHECK: (type $i32_i32_externref_=>_externref (func (param i32 i32 externref) (result externref)))
+
+ ;; CHECK: (type $i32_i32_anyref_=>_anyref (func (param i32 i32 anyref) (result anyref)))
+
+ ;; CHECK: (type $i32_i32_eqref_=>_eqref (func (param i32 i32 eqref) (result eqref)))
+
+ ;; CHECK: (type $i32_i32_i31ref_=>_i31ref (func (param i32 i32 i31ref) (result i31ref)))
+
+ ;; CHECK: (type $i32_i32_dataref_=>_dataref (func (param i32 i32 dataref) (result dataref)))
+
+ ;; CHECK: (type $i32_i32_v128_=>_v128 (func (param i32 i32 v128) (result v128)))
+
+ ;; CHECK: (type $none_=>_none (func))
+
+ ;; CHECK: (import "env" "get_i32" (func $get_i32 (param i32 i32 i32) (result i32)))
+
+ ;; CHECK: (import "env" "get_i64" (func $get_i64 (param i32 i32 i64) (result i64)))
+
+ ;; CHECK: (import "env" "get_f32" (func $get_f32 (param i32 i32 f32) (result f32)))
+
+ ;; CHECK: (import "env" "get_f64" (func $get_f64 (param i32 i32 f64) (result f64)))
+
+ ;; CHECK: (import "env" "set_i32" (func $set_i32 (param i32 i32 i32) (result i32)))
+
+ ;; CHECK: (import "env" "set_i64" (func $set_i64 (param i32 i32 i64) (result i64)))
+
+ ;; CHECK: (import "env" "set_f32" (func $set_f32 (param i32 i32 f32) (result f32)))
+
+ ;; CHECK: (import "env" "set_f64" (func $set_f64 (param i32 i32 f64) (result f64)))
+
+ ;; CHECK: (import "env" "get_funcref" (func $get_funcref (param i32 i32 funcref) (result funcref)))
+
+ ;; CHECK: (import "env" "set_funcref" (func $set_funcref (param i32 i32 funcref) (result funcref)))
+
+ ;; CHECK: (import "env" "get_externref" (func $get_externref (param i32 i32 externref) (result externref)))
+
+ ;; CHECK: (import "env" "set_externref" (func $set_externref (param i32 i32 externref) (result externref)))
+
+ ;; CHECK: (import "env" "get_anyref" (func $get_anyref (param i32 i32 anyref) (result anyref)))
+
+ ;; CHECK: (import "env" "set_anyref" (func $set_anyref (param i32 i32 anyref) (result anyref)))
+
+ ;; CHECK: (import "env" "get_eqref" (func $get_eqref (param i32 i32 eqref) (result eqref)))
+
+ ;; CHECK: (import "env" "set_eqref" (func $set_eqref (param i32 i32 eqref) (result eqref)))
+
+ ;; CHECK: (import "env" "get_i31ref" (func $get_i31ref (param i32 i32 i31ref) (result i31ref)))
+
+ ;; CHECK: (import "env" "set_i31ref" (func $set_i31ref (param i32 i32 i31ref) (result i31ref)))
+
+ ;; CHECK: (import "env" "get_dataref" (func $get_dataref (param i32 i32 dataref) (result dataref)))
+
+ ;; CHECK: (import "env" "set_dataref" (func $set_dataref (param i32 i32 dataref) (result dataref)))
+
+ ;; CHECK: (import "env" "get_v128" (func $get_v128 (param i32 i32 v128) (result v128)))
+
+ ;; CHECK: (import "env" "set_v128" (func $set_v128 (param i32 i32 v128) (result v128)))
+
+ ;; CHECK: (elem declare func $test)
+
+ ;; CHECK: (func $test
+ ;; CHECK-NEXT: (local $x i32)
+ ;; CHECK-NEXT: (local $y i64)
+ ;; CHECK-NEXT: (local $z f32)
+ ;; CHECK-NEXT: (local $w f64)
+ ;; CHECK-NEXT: (local $F funcref)
+ ;; CHECK-NEXT: (local $X externref)
+ ;; CHECK-NEXT: (local $S v128)
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $get_i32
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (local.get $x)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (local.get $y)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $get_f32
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (local.get $z)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $get_f64
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 3)
+ ;; CHECK-NEXT: (local.get $w)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $get_funcref
+ ;; CHECK-NEXT: (i32.const 3)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (local.get $F)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $get_externref
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 5)
+ ;; CHECK-NEXT: (local.get $X)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $get_i32
+ ;; CHECK-NEXT: (i32.const 5)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (local.get $x)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (local.get $y)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $get_f32
+ ;; CHECK-NEXT: (i32.const 6)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (local.get $z)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $get_f64
+ ;; CHECK-NEXT: (i32.const 7)
+ ;; CHECK-NEXT: (i32.const 3)
+ ;; CHECK-NEXT: (local.get $w)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $get_funcref
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (local.get $F)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $get_externref
+ ;; CHECK-NEXT: (i32.const 9)
+ ;; CHECK-NEXT: (i32.const 5)
+ ;; CHECK-NEXT: (local.get $X)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $x
+ ;; CHECK-NEXT: (call $set_i32
+ ;; CHECK-NEXT: (i32.const 10)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $y
+ ;; CHECK-NEXT: (i64.const 2)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $z
+ ;; CHECK-NEXT: (call $set_f32
+ ;; CHECK-NEXT: (i32.const 11)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (f32.const 3.2100000381469727)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $w
+ ;; CHECK-NEXT: (call $set_f64
+ ;; CHECK-NEXT: (i32.const 12)
+ ;; CHECK-NEXT: (i32.const 3)
+ ;; CHECK-NEXT: (f64.const 4.321)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $F
+ ;; CHECK-NEXT: (ref.func $test)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $X
+ ;; CHECK-NEXT: (call $set_externref
+ ;; CHECK-NEXT: (i32.const 14)
+ ;; CHECK-NEXT: (i32.const 5)
+ ;; CHECK-NEXT: (call $get_externref
+ ;; CHECK-NEXT: (i32.const 13)
+ ;; CHECK-NEXT: (i32.const 5)
+ ;; CHECK-NEXT: (local.get $X)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $x
+ ;; CHECK-NEXT: (call $set_i32
+ ;; CHECK-NEXT: (i32.const 15)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 11)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $y
+ ;; CHECK-NEXT: (i64.const 22)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $z
+ ;; CHECK-NEXT: (call $set_f32
+ ;; CHECK-NEXT: (i32.const 16)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (f32.const 33.209999084472656)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $w
+ ;; CHECK-NEXT: (call $set_f64
+ ;; CHECK-NEXT: (i32.const 17)
+ ;; CHECK-NEXT: (i32.const 3)
+ ;; CHECK-NEXT: (f64.const 44.321)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $F
+ ;; CHECK-NEXT: (call $set_funcref
+ ;; CHECK-NEXT: (i32.const 19)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (call $get_funcref
+ ;; CHECK-NEXT: (i32.const 18)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (local.get $F)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $X
+ ;; CHECK-NEXT: (call $set_externref
+ ;; CHECK-NEXT: (i32.const 21)
+ ;; CHECK-NEXT: (i32.const 5)
+ ;; CHECK-NEXT: (call $get_externref
+ ;; CHECK-NEXT: (i32.const 20)
+ ;; CHECK-NEXT: (i32.const 5)
+ ;; CHECK-NEXT: (local.get $X)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $get_v128
+ ;; CHECK-NEXT: (i32.const 22)
+ ;; CHECK-NEXT: (i32.const 6)
+ ;; CHECK-NEXT: (local.get $S)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (local.set $S
+ ;; CHECK-NEXT: (call $set_v128
+ ;; CHECK-NEXT: (i32.const 23)
+ ;; CHECK-NEXT: (i32.const 6)
+ ;; CHECK-NEXT: (v128.const i32x4 0x00000000 0x00000001 0x00000002 0x00000003)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $test
+ (local $x i32)
+ (local $y i64)
+ (local $z f32)
+ (local $w f64)
+ (local $F funcref)
+ (local $X externref)
+ (local $S v128)
+
+ (drop (local.get $x))
+ (drop (local.get $y))
+ (drop (local.get $z))
+ (drop (local.get $w))
+ (drop (local.get $F))
+ (drop (local.get $X))
+
+ (drop (local.get $x))
+ (drop (local.get $y))
+ (drop (local.get $z))
+ (drop (local.get $w))
+ (drop (local.get $F))
+ (drop (local.get $X))
+
+ (local.set $x (i32.const 1))
+ (local.set $y (i64.const 2))
+ (local.set $z (f32.const 3.21))
+ (local.set $w (f64.const 4.321))
+ (local.set $F (ref.func $test))
+ (local.set $X (local.get $X))
+
+ (local.set $x (i32.const 11))
+ (local.set $y (i64.const 22))
+ (local.set $z (f32.const 33.21))
+ (local.set $w (f64.const 44.321))
+ (local.set $F (local.get $F))
+ (local.set $X (local.get $X))
+
+ ;; 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))
+ )
+)
diff --git a/test/lit/passes/instrument-memory.wast b/test/lit/passes/instrument-memory.wast
new file mode 100644
index 000000000..a5712e90f
--- /dev/null
+++ b/test/lit/passes/instrument-memory.wast
@@ -0,0 +1,679 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+;; NOTE: This test was ported using port_test.py and could be cleaned up.
+
+;; RUN: foreach %s %t wasm-opt --instrument-memory -S -o - | filecheck %s
+
+(module
+ (memory 256 256)
+ ;; CHECK: (type $1 (func))
+ (type $1 (func))
+ ;; CHECK: (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32)))
+
+ ;; CHECK: (type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
+
+ ;; CHECK: (type $i32_i64_=>_i64 (func (param i32 i64) (result i64)))
+
+ ;; CHECK: (type $i32_f32_=>_f32 (func (param i32 f32) (result f32)))
+
+ ;; CHECK: (type $i32_f64_=>_f64 (func (param i32 f64) (result f64)))
+
+ ;; CHECK: (import "env" "load_ptr" (func $load_ptr (param i32 i32 i32 i32) (result i32)))
+
+ ;; CHECK: (import "env" "load_val_i32" (func $load_val_i32 (param i32 i32) (result i32)))
+
+ ;; CHECK: (import "env" "load_val_i64" (func $load_val_i64 (param i32 i64) (result i64)))
+
+ ;; CHECK: (import "env" "load_val_f32" (func $load_val_f32 (param i32 f32) (result f32)))
+
+ ;; CHECK: (import "env" "load_val_f64" (func $load_val_f64 (param i32 f64) (result f64)))
+
+ ;; CHECK: (import "env" "store_ptr" (func $store_ptr (param i32 i32 i32 i32) (result i32)))
+
+ ;; CHECK: (import "env" "store_val_i32" (func $store_val_i32 (param i32 i32) (result i32)))
+
+ ;; CHECK: (import "env" "store_val_i64" (func $store_val_i64 (param i32 i64) (result i64)))
+
+ ;; CHECK: (import "env" "store_val_f32" (func $store_val_f32 (param i32 f32) (result f32)))
+
+ ;; CHECK: (import "env" "store_val_f64" (func $store_val_f64 (param i32 f64) (result f64)))
+
+ ;; CHECK: (memory $0 256 256)
+
+ ;; CHECK: (func $A
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.load8_s
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.load8_u
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 3)
+ ;; CHECK-NEXT: (i32.load16_s
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 3)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.load16_u
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 5)
+ ;; CHECK-NEXT: (i32.load
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 5)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 6)
+ ;; CHECK-NEXT: (i64.load8_s
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 6)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 7)
+ ;; CHECK-NEXT: (i64.load8_u
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 7)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i64.load16_s
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 9)
+ ;; CHECK-NEXT: (i64.load16_u
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 9)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 10)
+ ;; CHECK-NEXT: (i64.load32_s
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 10)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 11)
+ ;; CHECK-NEXT: (i64.load32_u
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 11)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 12)
+ ;; CHECK-NEXT: (i64.load
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 12)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_f32
+ ;; CHECK-NEXT: (i32.const 13)
+ ;; CHECK-NEXT: (f32.load
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 13)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_f64
+ ;; CHECK-NEXT: (i32.const 14)
+ ;; CHECK-NEXT: (f64.load
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 14)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 15)
+ ;; CHECK-NEXT: (i32.load8_s offset=1
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 15)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 16)
+ ;; CHECK-NEXT: (i32.load8_u offset=2
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 16)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 17)
+ ;; CHECK-NEXT: (i32.load16_s offset=3 align=1
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 17)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 3)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 18)
+ ;; CHECK-NEXT: (i32.load16_u offset=4 align=1
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 18)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 19)
+ ;; CHECK-NEXT: (i32.load offset=5 align=2
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 19)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 5)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 20)
+ ;; CHECK-NEXT: (i64.load8_s offset=6
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 20)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 6)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 21)
+ ;; CHECK-NEXT: (i64.load8_u offset=7
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 21)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 7)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 22)
+ ;; CHECK-NEXT: (i64.load16_s offset=8 align=1
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 22)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 23)
+ ;; CHECK-NEXT: (i64.load16_u offset=9 align=1
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 23)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 9)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 24)
+ ;; CHECK-NEXT: (i64.load32_s offset=10 align=2
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 24)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 10)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 25)
+ ;; CHECK-NEXT: (i64.load32_u offset=11 align=2
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 25)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 11)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 26)
+ ;; CHECK-NEXT: (i64.load offset=12 align=2
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 26)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i32.const 12)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_f32
+ ;; CHECK-NEXT: (i32.const 27)
+ ;; CHECK-NEXT: (f32.load offset=13 align=2
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 27)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 13)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_f64
+ ;; CHECK-NEXT: (i32.const 28)
+ ;; CHECK-NEXT: (f64.load offset=14 align=2
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 28)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i32.const 14)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $A (type $1)
+ (drop (i32.load8_s (i32.const 0)))
+ (drop (i32.load8_u (i32.const 0)))
+ (drop (i32.load16_s (i32.const 0)))
+ (drop (i32.load16_u (i32.const 0)))
+ (drop (i32.load (i32.const 0)))
+ (drop (i64.load8_s (i32.const 0)))
+ (drop (i64.load8_u (i32.const 0)))
+ (drop (i64.load16_s (i32.const 0)))
+ (drop (i64.load16_u (i32.const 0)))
+ (drop (i64.load32_s (i32.const 0)))
+ (drop (i64.load32_u (i32.const 0)))
+ (drop (i64.load (i32.const 0)))
+ (drop (f32.load (i32.const 0)))
+ (drop (f64.load (i32.const 0)))
+
+ (drop (i32.load8_s align=1 offset=1 (i32.const 0)))
+ (drop (i32.load8_u align=1 offset=2 (i32.const 0)))
+ (drop (i32.load16_s align=1 offset=3 (i32.const 0)))
+ (drop (i32.load16_u align=1 offset=4 (i32.const 0)))
+ (drop (i32.load align=2 offset=5 (i32.const 0)))
+ (drop (i64.load8_s align=1 offset=6 (i32.const 0)))
+ (drop (i64.load8_u align=1 offset=7 (i32.const 0)))
+ (drop (i64.load16_s align=1 offset=8 (i32.const 0)))
+ (drop (i64.load16_u align=1 offset=9 (i32.const 0)))
+ (drop (i64.load32_s align=2 offset=10 (i32.const 0)))
+ (drop (i64.load32_u align=2 offset=11 (i32.const 0)))
+ (drop (i64.load align=2 offset=12 (i32.const 0)))
+ (drop (f32.load align=2 offset=13 (i32.const 0)))
+ (drop (f64.load align=2 offset=14 (i32.const 0)))
+ )
+
+ ;; CHECK: (func $B
+ ;; CHECK-NEXT: (i32.store8
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 29)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i32
+ ;; CHECK-NEXT: (i32.const 29)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i32.store16
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 30)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i32
+ ;; CHECK-NEXT: (i32.const 30)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i32.store
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 31)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i32
+ ;; CHECK-NEXT: (i32.const 31)
+ ;; CHECK-NEXT: (i32.const 3)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.store8
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 32)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i64
+ ;; CHECK-NEXT: (i32.const 32)
+ ;; CHECK-NEXT: (i64.const 4)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.store16
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 33)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i64
+ ;; CHECK-NEXT: (i32.const 33)
+ ;; CHECK-NEXT: (i64.const 5)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.store32
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 34)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i64
+ ;; CHECK-NEXT: (i32.const 34)
+ ;; CHECK-NEXT: (i64.const 6)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.store
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 35)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i64
+ ;; CHECK-NEXT: (i32.const 35)
+ ;; CHECK-NEXT: (i64.const 7)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (f32.store
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 36)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_f32
+ ;; CHECK-NEXT: (i32.const 36)
+ ;; CHECK-NEXT: (f32.const 8)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (f64.store
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 37)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_f64
+ ;; CHECK-NEXT: (i32.const 37)
+ ;; CHECK-NEXT: (f64.const 9)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i32.store8 offset=1
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 38)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i32
+ ;; CHECK-NEXT: (i32.const 38)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i32.store16 offset=2 align=1
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 39)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i32
+ ;; CHECK-NEXT: (i32.const 39)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i32.store offset=3 align=2
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 40)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 3)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i32
+ ;; CHECK-NEXT: (i32.const 40)
+ ;; CHECK-NEXT: (i32.const 3)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.store8 offset=4
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 41)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i64
+ ;; CHECK-NEXT: (i32.const 41)
+ ;; CHECK-NEXT: (i64.const 4)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.store16 offset=5
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 42)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 5)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i64
+ ;; CHECK-NEXT: (i32.const 42)
+ ;; CHECK-NEXT: (i64.const 5)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.store32 offset=6 align=2
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 43)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 6)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i64
+ ;; CHECK-NEXT: (i32.const 43)
+ ;; CHECK-NEXT: (i64.const 6)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.store offset=7 align=2
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 44)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i32.const 7)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i64
+ ;; CHECK-NEXT: (i32.const 44)
+ ;; CHECK-NEXT: (i64.const 7)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (f32.store offset=8 align=2
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 45)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_f32
+ ;; CHECK-NEXT: (i32.const 45)
+ ;; CHECK-NEXT: (f32.const 8)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (f64.store offset=9 align=2
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 46)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i32.const 9)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_f64
+ ;; CHECK-NEXT: (i32.const 46)
+ ;; CHECK-NEXT: (f64.const 9)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $B (type $1)
+ (i32.store8 (i32.const 0) (i32.const 1))
+ (i32.store16 (i32.const 0) (i32.const 2))
+ (i32.store (i32.const 0) (i32.const 3))
+ (i64.store8 (i32.const 0) (i64.const 4))
+ (i64.store16 (i32.const 0) (i64.const 5))
+ (i64.store32 (i32.const 0) (i64.const 6))
+ (i64.store (i32.const 0) (i64.const 7))
+ (f32.store (i32.const 0) (f32.const 8))
+ (f64.store (i32.const 0) (f64.const 9))
+
+ (i32.store8 align=1 offset=1 (i32.const 0) (i32.const 1))
+ (i32.store16 align=1 offset=2 (i32.const 0) (i32.const 2))
+ (i32.store align=2 offset=3 (i32.const 0) (i32.const 3))
+ (i64.store8 align=1 offset=4 (i32.const 0) (i64.const 4))
+ (i64.store16 align=2 offset=5 (i32.const 0) (i64.const 5))
+ (i64.store32 align=2 offset=6 (i32.const 0) (i64.const 6))
+ (i64.store align=2 offset=7 (i32.const 0) (i64.const 7))
+ (f32.store align=2 offset=8 (i32.const 0) (f32.const 8))
+ (f64.store align=2 offset=9 (i32.const 0) (f64.const 9))
+ )
+)
diff --git a/test/lit/passes/instrument-memory64.wast b/test/lit/passes/instrument-memory64.wast
new file mode 100644
index 000000000..a8b20ccbf
--- /dev/null
+++ b/test/lit/passes/instrument-memory64.wast
@@ -0,0 +1,679 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+;; NOTE: This test was ported using port_test.py and could be cleaned up.
+
+;; RUN: foreach %s %t wasm-opt --instrument-memory --enable-memory64 -S -o - | filecheck %s
+
+(module
+ (memory i64 256 256)
+ ;; CHECK: (type $1 (func))
+ (type $1 (func))
+ ;; CHECK: (type $i32_i32_i64_i64_=>_i64 (func (param i32 i32 i64 i64) (result i64)))
+
+ ;; CHECK: (type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
+
+ ;; CHECK: (type $i32_i64_=>_i64 (func (param i32 i64) (result i64)))
+
+ ;; CHECK: (type $i32_f32_=>_f32 (func (param i32 f32) (result f32)))
+
+ ;; CHECK: (type $i32_f64_=>_f64 (func (param i32 f64) (result f64)))
+
+ ;; CHECK: (import "env" "load_ptr" (func $load_ptr (param i32 i32 i64 i64) (result i64)))
+
+ ;; CHECK: (import "env" "load_val_i32" (func $load_val_i32 (param i32 i32) (result i32)))
+
+ ;; CHECK: (import "env" "load_val_i64" (func $load_val_i64 (param i32 i64) (result i64)))
+
+ ;; CHECK: (import "env" "load_val_f32" (func $load_val_f32 (param i32 f32) (result f32)))
+
+ ;; CHECK: (import "env" "load_val_f64" (func $load_val_f64 (param i32 f64) (result f64)))
+
+ ;; CHECK: (import "env" "store_ptr" (func $store_ptr (param i32 i32 i64 i64) (result i64)))
+
+ ;; CHECK: (import "env" "store_val_i32" (func $store_val_i32 (param i32 i32) (result i32)))
+
+ ;; CHECK: (import "env" "store_val_i64" (func $store_val_i64 (param i32 i64) (result i64)))
+
+ ;; CHECK: (import "env" "store_val_f32" (func $store_val_f32 (param i32 f32) (result f32)))
+
+ ;; CHECK: (import "env" "store_val_f64" (func $store_val_f64 (param i32 f64) (result f64)))
+
+ ;; CHECK: (memory $0 i64 256 256)
+
+ ;; CHECK: (func $A
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.load8_s
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.load8_u
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 3)
+ ;; CHECK-NEXT: (i32.load16_s
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 3)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.load16_u
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 5)
+ ;; CHECK-NEXT: (i32.load
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 5)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 6)
+ ;; CHECK-NEXT: (i64.load8_s
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 6)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 7)
+ ;; CHECK-NEXT: (i64.load8_u
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 7)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i64.load16_s
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 9)
+ ;; CHECK-NEXT: (i64.load16_u
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 9)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 10)
+ ;; CHECK-NEXT: (i64.load32_s
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 10)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 11)
+ ;; CHECK-NEXT: (i64.load32_u
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 11)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 12)
+ ;; CHECK-NEXT: (i64.load
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 12)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_f32
+ ;; CHECK-NEXT: (i32.const 13)
+ ;; CHECK-NEXT: (f32.load
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 13)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_f64
+ ;; CHECK-NEXT: (i32.const 14)
+ ;; CHECK-NEXT: (f64.load
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 14)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 15)
+ ;; CHECK-NEXT: (i32.load8_s offset=1
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 15)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i64.const 1)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 16)
+ ;; CHECK-NEXT: (i32.load8_u offset=2
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 16)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i64.const 2)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 17)
+ ;; CHECK-NEXT: (i32.load16_s offset=3 align=1
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 17)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i64.const 3)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 18)
+ ;; CHECK-NEXT: (i32.load16_u offset=4 align=1
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 18)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i64.const 4)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i32
+ ;; CHECK-NEXT: (i32.const 19)
+ ;; CHECK-NEXT: (i32.load offset=5 align=2
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 19)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i64.const 5)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 20)
+ ;; CHECK-NEXT: (i64.load8_s offset=6
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 20)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i64.const 6)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 21)
+ ;; CHECK-NEXT: (i64.load8_u offset=7
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 21)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i64.const 7)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 22)
+ ;; CHECK-NEXT: (i64.load16_s offset=8 align=1
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 22)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i64.const 8)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 23)
+ ;; CHECK-NEXT: (i64.load16_u offset=9 align=1
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 23)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i64.const 9)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 24)
+ ;; CHECK-NEXT: (i64.load32_s offset=10 align=2
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 24)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i64.const 10)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 25)
+ ;; CHECK-NEXT: (i64.load32_u offset=11 align=2
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 25)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i64.const 11)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_i64
+ ;; CHECK-NEXT: (i32.const 26)
+ ;; CHECK-NEXT: (i64.load offset=12 align=2
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 26)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i64.const 12)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_f32
+ ;; CHECK-NEXT: (i32.const 27)
+ ;; CHECK-NEXT: (f32.load offset=13 align=2
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 27)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i64.const 13)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (call $load_val_f64
+ ;; CHECK-NEXT: (i32.const 28)
+ ;; CHECK-NEXT: (f64.load offset=14 align=2
+ ;; CHECK-NEXT: (call $load_ptr
+ ;; CHECK-NEXT: (i32.const 28)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i64.const 14)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $A (type $1)
+ (drop (i32.load8_s (i64.const 0)))
+ (drop (i32.load8_u (i64.const 0)))
+ (drop (i32.load16_s (i64.const 0)))
+ (drop (i32.load16_u (i64.const 0)))
+ (drop (i32.load (i64.const 0)))
+ (drop (i64.load8_s (i64.const 0)))
+ (drop (i64.load8_u (i64.const 0)))
+ (drop (i64.load16_s (i64.const 0)))
+ (drop (i64.load16_u (i64.const 0)))
+ (drop (i64.load32_s (i64.const 0)))
+ (drop (i64.load32_u (i64.const 0)))
+ (drop (i64.load (i64.const 0)))
+ (drop (f32.load (i64.const 0)))
+ (drop (f64.load (i64.const 0)))
+
+ (drop (i32.load8_s align=1 offset=1 (i64.const 0)))
+ (drop (i32.load8_u align=1 offset=2 (i64.const 0)))
+ (drop (i32.load16_s align=1 offset=3 (i64.const 0)))
+ (drop (i32.load16_u align=1 offset=4 (i64.const 0)))
+ (drop (i32.load align=2 offset=5 (i64.const 0)))
+ (drop (i64.load8_s align=1 offset=6 (i64.const 0)))
+ (drop (i64.load8_u align=1 offset=7 (i64.const 0)))
+ (drop (i64.load16_s align=1 offset=8 (i64.const 0)))
+ (drop (i64.load16_u align=1 offset=9 (i64.const 0)))
+ (drop (i64.load32_s align=2 offset=10 (i64.const 0)))
+ (drop (i64.load32_u align=2 offset=11 (i64.const 0)))
+ (drop (i64.load align=2 offset=12 (i64.const 0)))
+ (drop (f32.load align=2 offset=13 (i64.const 0)))
+ (drop (f64.load align=2 offset=14 (i64.const 0)))
+ )
+
+ ;; CHECK: (func $B
+ ;; CHECK-NEXT: (i32.store8
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 29)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i32
+ ;; CHECK-NEXT: (i32.const 29)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i32.store16
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 30)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i32
+ ;; CHECK-NEXT: (i32.const 30)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i32.store
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 31)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i32
+ ;; CHECK-NEXT: (i32.const 31)
+ ;; CHECK-NEXT: (i32.const 3)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.store8
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 32)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i64
+ ;; CHECK-NEXT: (i32.const 32)
+ ;; CHECK-NEXT: (i64.const 4)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.store16
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 33)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i64
+ ;; CHECK-NEXT: (i32.const 33)
+ ;; CHECK-NEXT: (i64.const 5)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.store32
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 34)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i64
+ ;; CHECK-NEXT: (i32.const 34)
+ ;; CHECK-NEXT: (i64.const 6)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.store
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 35)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i64
+ ;; CHECK-NEXT: (i32.const 35)
+ ;; CHECK-NEXT: (i64.const 7)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (f32.store
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 36)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_f32
+ ;; CHECK-NEXT: (i32.const 36)
+ ;; CHECK-NEXT: (f32.const 8)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (f64.store
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 37)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_f64
+ ;; CHECK-NEXT: (i32.const 37)
+ ;; CHECK-NEXT: (f64.const 9)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i32.store8 offset=1
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 38)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i64.const 1)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i32
+ ;; CHECK-NEXT: (i32.const 38)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i32.store16 offset=2 align=1
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 39)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i64.const 2)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i32
+ ;; CHECK-NEXT: (i32.const 39)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i32.store offset=3 align=2
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 40)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i64.const 3)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i32
+ ;; CHECK-NEXT: (i32.const 40)
+ ;; CHECK-NEXT: (i32.const 3)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.store8 offset=4
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 41)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i64.const 4)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i64
+ ;; CHECK-NEXT: (i32.const 41)
+ ;; CHECK-NEXT: (i64.const 4)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.store16 offset=5
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 42)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (i64.const 5)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i64
+ ;; CHECK-NEXT: (i32.const 42)
+ ;; CHECK-NEXT: (i64.const 5)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.store32 offset=6 align=2
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 43)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i64.const 6)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i64
+ ;; CHECK-NEXT: (i32.const 43)
+ ;; CHECK-NEXT: (i64.const 6)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (i64.store offset=7 align=2
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 44)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i64.const 7)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_i64
+ ;; CHECK-NEXT: (i32.const 44)
+ ;; CHECK-NEXT: (i64.const 7)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (f32.store offset=8 align=2
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 45)
+ ;; CHECK-NEXT: (i32.const 4)
+ ;; CHECK-NEXT: (i64.const 8)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_f32
+ ;; CHECK-NEXT: (i32.const 45)
+ ;; CHECK-NEXT: (f32.const 8)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (f64.store offset=9 align=2
+ ;; CHECK-NEXT: (call $store_ptr
+ ;; CHECK-NEXT: (i32.const 46)
+ ;; CHECK-NEXT: (i32.const 8)
+ ;; CHECK-NEXT: (i64.const 9)
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (call $store_val_f64
+ ;; CHECK-NEXT: (i32.const 46)
+ ;; CHECK-NEXT: (f64.const 9)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $B (type $1)
+ (i32.store8 (i64.const 0) (i32.const 1))
+ (i32.store16 (i64.const 0) (i32.const 2))
+ (i32.store (i64.const 0) (i32.const 3))
+ (i64.store8 (i64.const 0) (i64.const 4))
+ (i64.store16 (i64.const 0) (i64.const 5))
+ (i64.store32 (i64.const 0) (i64.const 6))
+ (i64.store (i64.const 0) (i64.const 7))
+ (f32.store (i64.const 0) (f32.const 8))
+ (f64.store (i64.const 0) (f64.const 9))
+
+ (i32.store8 align=1 offset=1 (i64.const 0) (i32.const 1))
+ (i32.store16 align=1 offset=2 (i64.const 0) (i32.const 2))
+ (i32.store align=2 offset=3 (i64.const 0) (i32.const 3))
+ (i64.store8 align=1 offset=4 (i64.const 0) (i64.const 4))
+ (i64.store16 align=2 offset=5 (i64.const 0) (i64.const 5))
+ (i64.store32 align=2 offset=6 (i64.const 0) (i64.const 6))
+ (i64.store align=2 offset=7 (i64.const 0) (i64.const 7))
+ (f32.store align=2 offset=8 (i64.const 0) (f32.const 8))
+ (f64.store align=2 offset=9 (i64.const 0) (f64.const 9))
+ )
+)
diff --git a/test/passes/fpcast-emu.txt b/test/passes/fpcast-emu.txt
deleted file mode 100644
index 3aec01f13..000000000
--- a/test/passes/fpcast-emu.txt
+++ /dev/null
@@ -1,312 +0,0 @@
-(module
- (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64 (func (param i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64) (result i64)))
- (type $i32_i64_f32_f64_=>_f32 (func (param i32 i64 f32 f64) (result f32)))
- (type $vijfd (func (param i32 i64 f32 f64)))
- (type $jii (func (param i32 i32) (result i64)))
- (type $fjj (func (param i64 i64) (result f32)))
- (type $dff (func (param f32 f32) (result f64)))
- (type $idd (func (param f64 f64) (result i32)))
- (import "env" "imported_func" (func $imported-func (param i32 i64 f32 f64) (result f32)))
- (table $0 10 10 funcref)
- (elem (i32.const 0) $byn$fpcast-emu$a $byn$fpcast-emu$b $byn$fpcast-emu$c $byn$fpcast-emu$d $byn$fpcast-emu$e $byn$fpcast-emu$e $byn$fpcast-emu$imported-func)
- (func $a (param $x i32) (param $y i64) (param $z f32) (param $w f64)
- (drop
- (call_indirect (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64)
- (i64.extend_i32_u
- (i32.const 1)
- )
- (i64.const 2)
- (i64.extend_i32_u
- (i32.reinterpret_f32
- (f32.const 3)
- )
- )
- (i64.reinterpret_f64
- (f64.const 4)
- )
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i32.const 1337)
- )
- )
- )
- (func $b (param $x i32) (param $y i32) (result i64)
- (call_indirect (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64)
- (i64.extend_i32_u
- (i32.const 1)
- )
- (i64.extend_i32_u
- (i32.const 2)
- )
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i32.const 1337)
- )
- )
- (func $c (param $x i64) (param $y i64) (result f32)
- (f32.reinterpret_i32
- (i32.wrap_i64
- (call_indirect (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64)
- (i64.const 1)
- (i64.const 2)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i32.const 1337)
- )
- )
- )
- )
- (func $d (param $x f32) (param $y f32) (result f64)
- (f64.reinterpret_i64
- (call_indirect (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64)
- (i64.extend_i32_u
- (i32.reinterpret_f32
- (f32.const 1)
- )
- )
- (i64.extend_i32_u
- (i32.reinterpret_f32
- (f32.const 2)
- )
- )
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i32.const 1337)
- )
- )
- )
- (func $e (param $x f64) (param $y f64) (result i32)
- (i32.wrap_i64
- (call_indirect (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64)
- (i64.reinterpret_f64
- (f64.const 1)
- )
- (i64.reinterpret_f64
- (f64.const 2)
- )
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i32.const 1337)
- )
- )
- )
- (func $byn$fpcast-emu$a (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i64) (param $6 i64) (param $7 i64) (param $8 i64) (param $9 i64) (param $10 i64) (param $11 i64) (param $12 i64) (param $13 i64) (param $14 i64) (param $15 i64) (result i64)
- (call $a
- (i32.wrap_i64
- (local.get $0)
- )
- (local.get $1)
- (f32.reinterpret_i32
- (i32.wrap_i64
- (local.get $2)
- )
- )
- (f64.reinterpret_i64
- (local.get $3)
- )
- )
- (i64.const 0)
- )
- (func $byn$fpcast-emu$b (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i64) (param $6 i64) (param $7 i64) (param $8 i64) (param $9 i64) (param $10 i64) (param $11 i64) (param $12 i64) (param $13 i64) (param $14 i64) (param $15 i64) (result i64)
- (call $b
- (i32.wrap_i64
- (local.get $0)
- )
- (i32.wrap_i64
- (local.get $1)
- )
- )
- )
- (func $byn$fpcast-emu$c (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i64) (param $6 i64) (param $7 i64) (param $8 i64) (param $9 i64) (param $10 i64) (param $11 i64) (param $12 i64) (param $13 i64) (param $14 i64) (param $15 i64) (result i64)
- (i64.extend_i32_u
- (i32.reinterpret_f32
- (call $c
- (local.get $0)
- (local.get $1)
- )
- )
- )
- )
- (func $byn$fpcast-emu$d (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i64) (param $6 i64) (param $7 i64) (param $8 i64) (param $9 i64) (param $10 i64) (param $11 i64) (param $12 i64) (param $13 i64) (param $14 i64) (param $15 i64) (result i64)
- (i64.reinterpret_f64
- (call $d
- (f32.reinterpret_i32
- (i32.wrap_i64
- (local.get $0)
- )
- )
- (f32.reinterpret_i32
- (i32.wrap_i64
- (local.get $1)
- )
- )
- )
- )
- )
- (func $byn$fpcast-emu$e (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i64) (param $6 i64) (param $7 i64) (param $8 i64) (param $9 i64) (param $10 i64) (param $11 i64) (param $12 i64) (param $13 i64) (param $14 i64) (param $15 i64) (result i64)
- (i64.extend_i32_u
- (call $e
- (f64.reinterpret_i64
- (local.get $0)
- )
- (f64.reinterpret_i64
- (local.get $1)
- )
- )
- )
- )
- (func $byn$fpcast-emu$imported-func (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i64) (param $6 i64) (param $7 i64) (param $8 i64) (param $9 i64) (param $10 i64) (param $11 i64) (param $12 i64) (param $13 i64) (param $14 i64) (param $15 i64) (result i64)
- (i64.extend_i32_u
- (i32.reinterpret_f32
- (call $imported-func
- (i32.wrap_i64
- (local.get $0)
- )
- (local.get $1)
- (f32.reinterpret_i32
- (i32.wrap_i64
- (local.get $2)
- )
- )
- (f64.reinterpret_i64
- (local.get $3)
- )
- )
- )
- )
- )
-)
-(module
- (type $1 (func (param f32) (result i64)))
- (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64 (func (param i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64) (result i64)))
- (global $global$0 (mut i32) (i32.const 10))
- (table $0 42 42 funcref)
- (export "func_106" (func $0))
- (func $0 (param $0 f32) (result i64)
- (block $label$1 (result i64)
- (loop $label$2
- (global.set $global$0
- (i32.const 0)
- )
- (call_indirect (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64)
- (br $label$1
- (i64.const 4294967295)
- )
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i64.const 0)
- (i32.const 18)
- )
- )
- )
- )
-)
-(module
- (type $f32_=>_none (func (param f32)))
- (type $i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_i64_=>_i64 (func (param i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64) (result i64)))
- (type $f64_=>_none (func (param f64)))
- (table $0 42 42 funcref)
- (elem (i32.const 0) $byn$fpcast-emu$a $byn$fpcast-emu$b)
- (export "dynCall_vf" (func $dynCall_vf))
- (export "dynCall_vd" (func $min_vd))
- (func $a (param $0 f32)
- (nop)
- )
- (func $b (param $0 f64)
- (nop)
- )
- (func $dynCall_vf (param $0 f32)
- (nop)
- )
- (func $min_vd (param $0 f32)
- (nop)
- )
- (func $byn$fpcast-emu$a (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i64) (param $6 i64) (param $7 i64) (param $8 i64) (param $9 i64) (param $10 i64) (param $11 i64) (param $12 i64) (param $13 i64) (param $14 i64) (param $15 i64) (result i64)
- (call $a
- (f32.reinterpret_i32
- (i32.wrap_i64
- (local.get $0)
- )
- )
- )
- (i64.const 0)
- )
- (func $byn$fpcast-emu$b (param $0 i64) (param $1 i64) (param $2 i64) (param $3 i64) (param $4 i64) (param $5 i64) (param $6 i64) (param $7 i64) (param $8 i64) (param $9 i64) (param $10 i64) (param $11 i64) (param $12 i64) (param $13 i64) (param $14 i64) (param $15 i64) (result i64)
- (call $b
- (f64.reinterpret_i64
- (local.get $0)
- )
- )
- (i64.const 0)
- )
-)
diff --git a/test/passes/fpcast-emu.wast b/test/passes/fpcast-emu.wast
deleted file mode 100644
index 90af71d6f..000000000
--- a/test/passes/fpcast-emu.wast
+++ /dev/null
@@ -1,80 +0,0 @@
-(module
- (type $vijfd (func (param i32) (param i64) (param f32) (param f64)))
- (type $jii (func (param i32) (param i32) (result i64)))
- (type $fjj (func (param i64) (param i64) (result f32)))
- (type $dff (func (param f32) (param f32) (result f64)))
- (type $idd (func (param f64) (param f64) (result i32)))
- (import "env" "imported_func" (func $imported-func (param i32 i64 f32 f64) (result f32)))
- (table 10 10 funcref)
- (elem (i32.const 0) $a $b $c $d $e $e $imported-func)
- (func $a (param $x i32) (param $y i64) (param $z f32) (param $w f64)
- (call_indirect (type $vijfd)
- (i32.const 1)
- (i64.const 2)
- (f32.const 3)
- (f64.const 4)
- (i32.const 1337)
- )
- )
- (func $b (param $x i32) (param $y i32) (result i64)
- (call_indirect (type $jii)
- (i32.const 1)
- (i32.const 2)
- (i32.const 1337)
- )
- )
- (func $c (param $x i64) (param $y i64) (result f32)
- (call_indirect (type $fjj)
- (i64.const 1)
- (i64.const 2)
- (i32.const 1337)
- )
- )
- (func $d (param $x f32) (param $y f32) (result f64)
- (call_indirect (type $dff)
- (f32.const 1)
- (f32.const 2)
- (i32.const 1337)
- )
- )
- (func $e (param $x f64) (param $y f64) (result i32)
- (call_indirect (type $idd)
- (f64.const 1)
- (f64.const 2)
- (i32.const 1337)
- )
- )
-)
-(module
- (type $0 (func (param i64)))
- (type $1 (func (param f32) (result i64)))
- (global $global$0 (mut i32) (i32.const 10))
- (table 42 42 funcref)
- (export "func_106" (func $0))
- (func $0 (; 0 ;) (type $1) (param $0 f32) (result i64)
- (block $label$1 (result i64)
- (loop $label$2
- (global.set $global$0
- (i32.const 0)
- )
- (call_indirect (type $0)
- (br $label$1
- (i64.const 4294967295)
- )
- (i32.const 18)
- )
- )
- )
- )
-)
-(module
- (table 42 42 funcref)
- (elem (i32.const 0) $a $b)
- (export "dynCall_vf" (func $dynCall_vf))
- (export "dynCall_vd" (func $min_vd))
- (func $a (param $0 f32))
- (func $b (param $0 f64))
- (func $dynCall_vf (param $0 f32))
- (func $min_vd (param $0 f32))
-)
-
diff --git a/test/passes/generate-dyncalls_all-features.txt b/test/passes/generate-dyncalls_all-features.txt
deleted file mode 100644
index 08665b891..000000000
--- a/test/passes/generate-dyncalls_all-features.txt
+++ /dev/null
@@ -1,64 +0,0 @@
-(module
- (type $i32_i32_i32_=>_none (func (param i32 i32 i32)))
- (type $none_=>_i32 (func (result i32)))
- (type $i32_=>_i64 (func (param i32) (result i64)))
- (type $i32_=>_i32 (func (param i32) (result i32)))
- (type $i32_i32_=>_i64 (func (param i32 i32) (result i64)))
- (type $i32_i32_=>_none (func (param i32 i32)))
- (import "env" "invoke_vii" (func $invoke_vii (param i32 i32 i32)))
- (table $0 2 2 funcref)
- (elem (i32.const 0) $f1 $f2)
- (export "dynCall_i" (func $dynCall_i))
- (export "dynCall_ji" (func $dynCall_ji))
- (export "dynCall_vii" (func $dynCall_vii))
- (func $f1 (result i32)
- (i32.const 1024)
- )
- (func $f2 (param $0 i32) (result i64)
- (i64.const 42)
- )
- (func $dynCall_i (param $fptr i32) (result i32)
- (call_indirect $0 (type $none_=>_i32)
- (local.get $fptr)
- )
- )
- (func $dynCall_ji (param $fptr i32) (param $0 i32) (result i64)
- (call_indirect $0 (type $i32_=>_i64)
- (local.get $0)
- (local.get $fptr)
- )
- )
- (func $dynCall_vii (param $fptr i32) (param $0 i32) (param $1 i32)
- (call_indirect $0 (type $i32_i32_=>_none)
- (local.get $0)
- (local.get $1)
- (local.get $fptr)
- )
- )
-)
-(module
- (type $i32_i32_i32_=>_none (func (param i32 i32 i32)))
- (type $none_=>_i32 (func (result i32)))
- (type $i32_=>_i32 (func (param i32) (result i32)))
- (type $i32_i32_=>_none (func (param i32 i32)))
- (import "env" "table" (table $timport$0 1 1 funcref))
- (import "env" "invoke_vii" (func $invoke_vii (param i32 i32 i32)))
- (elem (i32.const 0) $f)
- (export "dynCall_i" (func $dynCall_i))
- (export "dynCall_vii" (func $dynCall_vii))
- (func $f (result i32)
- (i32.const 42)
- )
- (func $dynCall_i (param $fptr i32) (result i32)
- (call_indirect $timport$0 (type $none_=>_i32)
- (local.get $fptr)
- )
- )
- (func $dynCall_vii (param $fptr i32) (param $0 i32) (param $1 i32)
- (call_indirect $timport$0 (type $i32_i32_=>_none)
- (local.get $0)
- (local.get $1)
- (local.get $fptr)
- )
- )
-)
diff --git a/test/passes/generate-dyncalls_all-features.wast b/test/passes/generate-dyncalls_all-features.wast
deleted file mode 100644
index c73a6b6a5..000000000
--- a/test/passes/generate-dyncalls_all-features.wast
+++ /dev/null
@@ -1,19 +0,0 @@
-(module
- (import "env" "invoke_vii" (func $invoke_vii (param i32 i32 i32)))
- (func $f1 (result i32)
- (i32.const 1024)
- )
- (func $f2 (param i32) (result i64)
- (i64.const 42)
- )
- (table 2 2 funcref)
- (elem (i32.const 0) $f1 $f2)
-)
-(module
- (import "env" "invoke_vii" (func $invoke_vii (param i32 i32 i32)))
- (import "env" "table" (table 1 1 funcref))
- (elem (i32.const 0) $f)
- (func $f (result i32)
- (i32.const 42)
- )
-)
diff --git a/test/passes/generate-i64-dyncalls.txt b/test/passes/generate-i64-dyncalls.txt
deleted file mode 100644
index c9a282d84..000000000
--- a/test/passes/generate-i64-dyncalls.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-(module
- (type $i32_=>_i64 (func (param i32) (result i64)))
- (type $none_=>_i32 (func (result i32)))
- (type $i32_i32_=>_i64 (func (param i32 i32) (result i64)))
- (table $0 2 2 funcref)
- (elem (i32.const 0) $f1 $f2)
- (export "dynCall_ji" (func $dynCall_ji))
- (func $f1 (result i32)
- (i32.const 1024)
- )
- (func $f2 (param $0 i32) (result i64)
- (i64.const 42)
- )
- (func $dynCall_ji (param $fptr i32) (param $0 i32) (result i64)
- (call_indirect (type $i32_=>_i64)
- (local.get $0)
- (local.get $fptr)
- )
- )
-)
diff --git a/test/passes/generate-i64-dyncalls.wast b/test/passes/generate-i64-dyncalls.wast
deleted file mode 100644
index 6fbfcc331..000000000
--- a/test/passes/generate-i64-dyncalls.wast
+++ /dev/null
@@ -1,10 +0,0 @@
-(module
- (func $f1 (result i32)
- (i32.const 1024)
- )
- (func $f2 (param i32) (result i64)
- (i64.const 42)
- )
- (table 2 2 funcref)
- (elem (i32.const 0) $f1 $f2)
-)
diff --git a/test/passes/instrument-locals_all-features_disable-typed-function-references.txt b/test/passes/instrument-locals_all-features_disable-typed-function-references.txt
deleted file mode 100644
index e80161497..000000000
--- a/test/passes/instrument-locals_all-features_disable-typed-function-references.txt
+++ /dev/null
@@ -1,220 +0,0 @@
-(module
- (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
- (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_funcref_=>_funcref (func (param i32 i32 funcref) (result funcref)))
- (type $i32_i32_externref_=>_externref (func (param i32 i32 externref) (result externref)))
- (type $i32_i32_anyref_=>_anyref (func (param i32 i32 anyref) (result anyref)))
- (type $i32_i32_eqref_=>_eqref (func (param i32 i32 eqref) (result eqref)))
- (type $i32_i32_i31ref_=>_i31ref (func (param i32 i32 i31ref) (result i31ref)))
- (type $i32_i32_dataref_=>_dataref (func (param i32 i32 dataref) (result dataref)))
- (type $i32_i32_v128_=>_v128 (func (param i32 i32 v128) (result v128)))
- (type $none_=>_none (func))
- (import "env" "get_i32" (func $get_i32 (param i32 i32 i32) (result i32)))
- (import "env" "get_i64" (func $get_i64 (param i32 i32 i64) (result i64)))
- (import "env" "get_f32" (func $get_f32 (param i32 i32 f32) (result f32)))
- (import "env" "get_f64" (func $get_f64 (param i32 i32 f64) (result f64)))
- (import "env" "set_i32" (func $set_i32 (param i32 i32 i32) (result i32)))
- (import "env" "set_i64" (func $set_i64 (param i32 i32 i64) (result i64)))
- (import "env" "set_f32" (func $set_f32 (param i32 i32 f32) (result f32)))
- (import "env" "set_f64" (func $set_f64 (param i32 i32 f64) (result f64)))
- (import "env" "get_funcref" (func $get_funcref (param i32 i32 funcref) (result funcref)))
- (import "env" "set_funcref" (func $set_funcref (param i32 i32 funcref) (result funcref)))
- (import "env" "get_externref" (func $get_externref (param i32 i32 externref) (result externref)))
- (import "env" "set_externref" (func $set_externref (param i32 i32 externref) (result externref)))
- (import "env" "get_anyref" (func $get_anyref (param i32 i32 anyref) (result anyref)))
- (import "env" "set_anyref" (func $set_anyref (param i32 i32 anyref) (result anyref)))
- (import "env" "get_eqref" (func $get_eqref (param i32 i32 eqref) (result eqref)))
- (import "env" "set_eqref" (func $set_eqref (param i32 i32 eqref) (result eqref)))
- (import "env" "get_i31ref" (func $get_i31ref (param i32 i32 i31ref) (result i31ref)))
- (import "env" "set_i31ref" (func $set_i31ref (param i32 i32 i31ref) (result i31ref)))
- (import "env" "get_dataref" (func $get_dataref (param i32 i32 dataref) (result dataref)))
- (import "env" "set_dataref" (func $set_dataref (param i32 i32 dataref) (result dataref)))
- (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)))
- (elem declare func $test)
- (func $test
- (local $x i32)
- (local $y i64)
- (local $z f32)
- (local $w f64)
- (local $F funcref)
- (local $X externref)
- (local $S v128)
- (drop
- (call $get_i32
- (i32.const 0)
- (i32.const 0)
- (local.get $x)
- )
- )
- (drop
- (local.get $y)
- )
- (drop
- (call $get_f32
- (i32.const 1)
- (i32.const 2)
- (local.get $z)
- )
- )
- (drop
- (call $get_f64
- (i32.const 2)
- (i32.const 3)
- (local.get $w)
- )
- )
- (drop
- (call $get_funcref
- (i32.const 3)
- (i32.const 4)
- (local.get $F)
- )
- )
- (drop
- (call $get_externref
- (i32.const 4)
- (i32.const 5)
- (local.get $X)
- )
- )
- (drop
- (call $get_i32
- (i32.const 5)
- (i32.const 0)
- (local.get $x)
- )
- )
- (drop
- (local.get $y)
- )
- (drop
- (call $get_f32
- (i32.const 6)
- (i32.const 2)
- (local.get $z)
- )
- )
- (drop
- (call $get_f64
- (i32.const 7)
- (i32.const 3)
- (local.get $w)
- )
- )
- (drop
- (call $get_funcref
- (i32.const 8)
- (i32.const 4)
- (local.get $F)
- )
- )
- (drop
- (call $get_externref
- (i32.const 9)
- (i32.const 5)
- (local.get $X)
- )
- )
- (local.set $x
- (call $set_i32
- (i32.const 10)
- (i32.const 0)
- (i32.const 1)
- )
- )
- (local.set $y
- (i64.const 2)
- )
- (local.set $z
- (call $set_f32
- (i32.const 11)
- (i32.const 2)
- (f32.const 3.2100000381469727)
- )
- )
- (local.set $w
- (call $set_f64
- (i32.const 12)
- (i32.const 3)
- (f64.const 4.321)
- )
- )
- (local.set $F
- (ref.func $test)
- )
- (local.set $X
- (call $set_externref
- (i32.const 14)
- (i32.const 5)
- (call $get_externref
- (i32.const 13)
- (i32.const 5)
- (local.get $X)
- )
- )
- )
- (local.set $x
- (call $set_i32
- (i32.const 15)
- (i32.const 0)
- (i32.const 11)
- )
- )
- (local.set $y
- (i64.const 22)
- )
- (local.set $z
- (call $set_f32
- (i32.const 16)
- (i32.const 2)
- (f32.const 33.209999084472656)
- )
- )
- (local.set $w
- (call $set_f64
- (i32.const 17)
- (i32.const 3)
- (f64.const 44.321)
- )
- )
- (local.set $F
- (call $set_funcref
- (i32.const 19)
- (i32.const 4)
- (call $get_funcref
- (i32.const 18)
- (i32.const 4)
- (local.get $F)
- )
- )
- )
- (local.set $X
- (call $set_externref
- (i32.const 21)
- (i32.const 5)
- (call $get_externref
- (i32.const 20)
- (i32.const 5)
- (local.get $X)
- )
- )
- )
- (drop
- (call $get_v128
- (i32.const 22)
- (i32.const 6)
- (local.get $S)
- )
- )
- (local.set $S
- (call $set_v128
- (i32.const 23)
- (i32.const 6)
- (v128.const i32x4 0x00000000 0x00000001 0x00000002 0x00000003)
- )
- )
- )
-)
diff --git a/test/passes/instrument-locals_all-features_disable-typed-function-references.wast b/test/passes/instrument-locals_all-features_disable-typed-function-references.wast
deleted file mode 100644
index 45785c5f1..000000000
--- a/test/passes/instrument-locals_all-features_disable-typed-function-references.wast
+++ /dev/null
@@ -1,44 +0,0 @@
-(module
- (func $test
- (local $x i32)
- (local $y i64)
- (local $z f32)
- (local $w f64)
- (local $F funcref)
- (local $X externref)
- (local $S v128)
-
- (drop (local.get $x))
- (drop (local.get $y))
- (drop (local.get $z))
- (drop (local.get $w))
- (drop (local.get $F))
- (drop (local.get $X))
-
- (drop (local.get $x))
- (drop (local.get $y))
- (drop (local.get $z))
- (drop (local.get $w))
- (drop (local.get $F))
- (drop (local.get $X))
-
- (local.set $x (i32.const 1))
- (local.set $y (i64.const 2))
- (local.set $z (f32.const 3.21))
- (local.set $w (f64.const 4.321))
- (local.set $F (ref.func $test))
- (local.set $X (local.get $X))
-
- (local.set $x (i32.const 11))
- (local.set $y (i64.const 22))
- (local.set $z (f32.const 33.21))
- (local.set $w (f64.const 44.321))
- (local.set $F (local.get $F))
- (local.set $X (local.get $X))
-
- ;; 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))
- )
-)
diff --git a/test/passes/instrument-memory.txt b/test/passes/instrument-memory.txt
deleted file mode 100644
index 4df4378be..000000000
--- a/test/passes/instrument-memory.txt
+++ /dev/null
@@ -1,603 +0,0 @@
-(module
- (type $1 (func))
- (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32)))
- (type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
- (type $i32_i64_=>_i64 (func (param i32 i64) (result i64)))
- (type $i32_f32_=>_f32 (func (param i32 f32) (result f32)))
- (type $i32_f64_=>_f64 (func (param i32 f64) (result f64)))
- (import "env" "load_ptr" (func $load_ptr (param i32 i32 i32 i32) (result i32)))
- (import "env" "load_val_i32" (func $load_val_i32 (param i32 i32) (result i32)))
- (import "env" "load_val_i64" (func $load_val_i64 (param i32 i64) (result i64)))
- (import "env" "load_val_f32" (func $load_val_f32 (param i32 f32) (result f32)))
- (import "env" "load_val_f64" (func $load_val_f64 (param i32 f64) (result f64)))
- (import "env" "store_ptr" (func $store_ptr (param i32 i32 i32 i32) (result i32)))
- (import "env" "store_val_i32" (func $store_val_i32 (param i32 i32) (result i32)))
- (import "env" "store_val_i64" (func $store_val_i64 (param i32 i64) (result i64)))
- (import "env" "store_val_f32" (func $store_val_f32 (param i32 f32) (result f32)))
- (import "env" "store_val_f64" (func $store_val_f64 (param i32 f64) (result f64)))
- (memory $0 256 256)
- (func $A
- (drop
- (call $load_val_i32
- (i32.const 1)
- (i32.load8_s
- (call $load_ptr
- (i32.const 1)
- (i32.const 1)
- (i32.const 0)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 2)
- (i32.load8_u
- (call $load_ptr
- (i32.const 2)
- (i32.const 1)
- (i32.const 0)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 3)
- (i32.load16_s
- (call $load_ptr
- (i32.const 3)
- (i32.const 2)
- (i32.const 0)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 4)
- (i32.load16_u
- (call $load_ptr
- (i32.const 4)
- (i32.const 2)
- (i32.const 0)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 5)
- (i32.load
- (call $load_ptr
- (i32.const 5)
- (i32.const 4)
- (i32.const 0)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 6)
- (i64.load8_s
- (call $load_ptr
- (i32.const 6)
- (i32.const 1)
- (i32.const 0)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 7)
- (i64.load8_u
- (call $load_ptr
- (i32.const 7)
- (i32.const 1)
- (i32.const 0)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 8)
- (i64.load16_s
- (call $load_ptr
- (i32.const 8)
- (i32.const 2)
- (i32.const 0)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 9)
- (i64.load16_u
- (call $load_ptr
- (i32.const 9)
- (i32.const 2)
- (i32.const 0)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 10)
- (i64.load32_s
- (call $load_ptr
- (i32.const 10)
- (i32.const 4)
- (i32.const 0)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 11)
- (i64.load32_u
- (call $load_ptr
- (i32.const 11)
- (i32.const 4)
- (i32.const 0)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 12)
- (i64.load
- (call $load_ptr
- (i32.const 12)
- (i32.const 8)
- (i32.const 0)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_f32
- (i32.const 13)
- (f32.load
- (call $load_ptr
- (i32.const 13)
- (i32.const 4)
- (i32.const 0)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_f64
- (i32.const 14)
- (f64.load
- (call $load_ptr
- (i32.const 14)
- (i32.const 8)
- (i32.const 0)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 15)
- (i32.load8_s offset=1
- (call $load_ptr
- (i32.const 15)
- (i32.const 1)
- (i32.const 1)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 16)
- (i32.load8_u offset=2
- (call $load_ptr
- (i32.const 16)
- (i32.const 1)
- (i32.const 2)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 17)
- (i32.load16_s offset=3 align=1
- (call $load_ptr
- (i32.const 17)
- (i32.const 2)
- (i32.const 3)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 18)
- (i32.load16_u offset=4 align=1
- (call $load_ptr
- (i32.const 18)
- (i32.const 2)
- (i32.const 4)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 19)
- (i32.load offset=5 align=2
- (call $load_ptr
- (i32.const 19)
- (i32.const 4)
- (i32.const 5)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 20)
- (i64.load8_s offset=6
- (call $load_ptr
- (i32.const 20)
- (i32.const 1)
- (i32.const 6)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 21)
- (i64.load8_u offset=7
- (call $load_ptr
- (i32.const 21)
- (i32.const 1)
- (i32.const 7)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 22)
- (i64.load16_s offset=8 align=1
- (call $load_ptr
- (i32.const 22)
- (i32.const 2)
- (i32.const 8)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 23)
- (i64.load16_u offset=9 align=1
- (call $load_ptr
- (i32.const 23)
- (i32.const 2)
- (i32.const 9)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 24)
- (i64.load32_s offset=10 align=2
- (call $load_ptr
- (i32.const 24)
- (i32.const 4)
- (i32.const 10)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 25)
- (i64.load32_u offset=11 align=2
- (call $load_ptr
- (i32.const 25)
- (i32.const 4)
- (i32.const 11)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 26)
- (i64.load offset=12 align=2
- (call $load_ptr
- (i32.const 26)
- (i32.const 8)
- (i32.const 12)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_f32
- (i32.const 27)
- (f32.load offset=13 align=2
- (call $load_ptr
- (i32.const 27)
- (i32.const 4)
- (i32.const 13)
- (i32.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_f64
- (i32.const 28)
- (f64.load offset=14 align=2
- (call $load_ptr
- (i32.const 28)
- (i32.const 8)
- (i32.const 14)
- (i32.const 0)
- )
- )
- )
- )
- )
- (func $B
- (i32.store8
- (call $store_ptr
- (i32.const 29)
- (i32.const 1)
- (i32.const 0)
- (i32.const 0)
- )
- (call $store_val_i32
- (i32.const 29)
- (i32.const 1)
- )
- )
- (i32.store16
- (call $store_ptr
- (i32.const 30)
- (i32.const 2)
- (i32.const 0)
- (i32.const 0)
- )
- (call $store_val_i32
- (i32.const 30)
- (i32.const 2)
- )
- )
- (i32.store
- (call $store_ptr
- (i32.const 31)
- (i32.const 4)
- (i32.const 0)
- (i32.const 0)
- )
- (call $store_val_i32
- (i32.const 31)
- (i32.const 3)
- )
- )
- (i64.store8
- (call $store_ptr
- (i32.const 32)
- (i32.const 1)
- (i32.const 0)
- (i32.const 0)
- )
- (call $store_val_i64
- (i32.const 32)
- (i64.const 4)
- )
- )
- (i64.store16
- (call $store_ptr
- (i32.const 33)
- (i32.const 2)
- (i32.const 0)
- (i32.const 0)
- )
- (call $store_val_i64
- (i32.const 33)
- (i64.const 5)
- )
- )
- (i64.store32
- (call $store_ptr
- (i32.const 34)
- (i32.const 4)
- (i32.const 0)
- (i32.const 0)
- )
- (call $store_val_i64
- (i32.const 34)
- (i64.const 6)
- )
- )
- (i64.store
- (call $store_ptr
- (i32.const 35)
- (i32.const 8)
- (i32.const 0)
- (i32.const 0)
- )
- (call $store_val_i64
- (i32.const 35)
- (i64.const 7)
- )
- )
- (f32.store
- (call $store_ptr
- (i32.const 36)
- (i32.const 4)
- (i32.const 0)
- (i32.const 0)
- )
- (call $store_val_f32
- (i32.const 36)
- (f32.const 8)
- )
- )
- (f64.store
- (call $store_ptr
- (i32.const 37)
- (i32.const 8)
- (i32.const 0)
- (i32.const 0)
- )
- (call $store_val_f64
- (i32.const 37)
- (f64.const 9)
- )
- )
- (i32.store8 offset=1
- (call $store_ptr
- (i32.const 38)
- (i32.const 1)
- (i32.const 1)
- (i32.const 0)
- )
- (call $store_val_i32
- (i32.const 38)
- (i32.const 1)
- )
- )
- (i32.store16 offset=2 align=1
- (call $store_ptr
- (i32.const 39)
- (i32.const 2)
- (i32.const 2)
- (i32.const 0)
- )
- (call $store_val_i32
- (i32.const 39)
- (i32.const 2)
- )
- )
- (i32.store offset=3 align=2
- (call $store_ptr
- (i32.const 40)
- (i32.const 4)
- (i32.const 3)
- (i32.const 0)
- )
- (call $store_val_i32
- (i32.const 40)
- (i32.const 3)
- )
- )
- (i64.store8 offset=4
- (call $store_ptr
- (i32.const 41)
- (i32.const 1)
- (i32.const 4)
- (i32.const 0)
- )
- (call $store_val_i64
- (i32.const 41)
- (i64.const 4)
- )
- )
- (i64.store16 offset=5
- (call $store_ptr
- (i32.const 42)
- (i32.const 2)
- (i32.const 5)
- (i32.const 0)
- )
- (call $store_val_i64
- (i32.const 42)
- (i64.const 5)
- )
- )
- (i64.store32 offset=6 align=2
- (call $store_ptr
- (i32.const 43)
- (i32.const 4)
- (i32.const 6)
- (i32.const 0)
- )
- (call $store_val_i64
- (i32.const 43)
- (i64.const 6)
- )
- )
- (i64.store offset=7 align=2
- (call $store_ptr
- (i32.const 44)
- (i32.const 8)
- (i32.const 7)
- (i32.const 0)
- )
- (call $store_val_i64
- (i32.const 44)
- (i64.const 7)
- )
- )
- (f32.store offset=8 align=2
- (call $store_ptr
- (i32.const 45)
- (i32.const 4)
- (i32.const 8)
- (i32.const 0)
- )
- (call $store_val_f32
- (i32.const 45)
- (f32.const 8)
- )
- )
- (f64.store offset=9 align=2
- (call $store_ptr
- (i32.const 46)
- (i32.const 8)
- (i32.const 9)
- (i32.const 0)
- )
- (call $store_val_f64
- (i32.const 46)
- (f64.const 9)
- )
- )
- )
-)
diff --git a/test/passes/instrument-memory.wast b/test/passes/instrument-memory.wast
deleted file mode 100644
index 2dddd8405..000000000
--- a/test/passes/instrument-memory.wast
+++ /dev/null
@@ -1,57 +0,0 @@
-(module
- (memory 256 256)
- (type $1 (func))
- (func $A (type $1)
- (drop (i32.load8_s (i32.const 0)))
- (drop (i32.load8_u (i32.const 0)))
- (drop (i32.load16_s (i32.const 0)))
- (drop (i32.load16_u (i32.const 0)))
- (drop (i32.load (i32.const 0)))
- (drop (i64.load8_s (i32.const 0)))
- (drop (i64.load8_u (i32.const 0)))
- (drop (i64.load16_s (i32.const 0)))
- (drop (i64.load16_u (i32.const 0)))
- (drop (i64.load32_s (i32.const 0)))
- (drop (i64.load32_u (i32.const 0)))
- (drop (i64.load (i32.const 0)))
- (drop (f32.load (i32.const 0)))
- (drop (f64.load (i32.const 0)))
-
- (drop (i32.load8_s align=1 offset=1 (i32.const 0)))
- (drop (i32.load8_u align=1 offset=2 (i32.const 0)))
- (drop (i32.load16_s align=1 offset=3 (i32.const 0)))
- (drop (i32.load16_u align=1 offset=4 (i32.const 0)))
- (drop (i32.load align=2 offset=5 (i32.const 0)))
- (drop (i64.load8_s align=1 offset=6 (i32.const 0)))
- (drop (i64.load8_u align=1 offset=7 (i32.const 0)))
- (drop (i64.load16_s align=1 offset=8 (i32.const 0)))
- (drop (i64.load16_u align=1 offset=9 (i32.const 0)))
- (drop (i64.load32_s align=2 offset=10 (i32.const 0)))
- (drop (i64.load32_u align=2 offset=11 (i32.const 0)))
- (drop (i64.load align=2 offset=12 (i32.const 0)))
- (drop (f32.load align=2 offset=13 (i32.const 0)))
- (drop (f64.load align=2 offset=14 (i32.const 0)))
- )
-
- (func $B (type $1)
- (i32.store8 (i32.const 0) (i32.const 1))
- (i32.store16 (i32.const 0) (i32.const 2))
- (i32.store (i32.const 0) (i32.const 3))
- (i64.store8 (i32.const 0) (i64.const 4))
- (i64.store16 (i32.const 0) (i64.const 5))
- (i64.store32 (i32.const 0) (i64.const 6))
- (i64.store (i32.const 0) (i64.const 7))
- (f32.store (i32.const 0) (f32.const 8))
- (f64.store (i32.const 0) (f64.const 9))
-
- (i32.store8 align=1 offset=1 (i32.const 0) (i32.const 1))
- (i32.store16 align=1 offset=2 (i32.const 0) (i32.const 2))
- (i32.store align=2 offset=3 (i32.const 0) (i32.const 3))
- (i64.store8 align=1 offset=4 (i32.const 0) (i64.const 4))
- (i64.store16 align=2 offset=5 (i32.const 0) (i64.const 5))
- (i64.store32 align=2 offset=6 (i32.const 0) (i64.const 6))
- (i64.store align=2 offset=7 (i32.const 0) (i64.const 7))
- (f32.store align=2 offset=8 (i32.const 0) (f32.const 8))
- (f64.store align=2 offset=9 (i32.const 0) (f64.const 9))
- )
-)
diff --git a/test/passes/instrument-memory64.passes b/test/passes/instrument-memory64.passes
deleted file mode 100644
index 3dac09045..000000000
--- a/test/passes/instrument-memory64.passes
+++ /dev/null
@@ -1 +0,0 @@
-instrument-memory_enable-memory64
diff --git a/test/passes/instrument-memory64.txt b/test/passes/instrument-memory64.txt
deleted file mode 100644
index 7ab2f152a..000000000
--- a/test/passes/instrument-memory64.txt
+++ /dev/null
@@ -1,603 +0,0 @@
-(module
- (type $1 (func))
- (type $i32_i32_i64_i64_=>_i64 (func (param i32 i32 i64 i64) (result i64)))
- (type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
- (type $i32_i64_=>_i64 (func (param i32 i64) (result i64)))
- (type $i32_f32_=>_f32 (func (param i32 f32) (result f32)))
- (type $i32_f64_=>_f64 (func (param i32 f64) (result f64)))
- (import "env" "load_ptr" (func $load_ptr (param i32 i32 i64 i64) (result i64)))
- (import "env" "load_val_i32" (func $load_val_i32 (param i32 i32) (result i32)))
- (import "env" "load_val_i64" (func $load_val_i64 (param i32 i64) (result i64)))
- (import "env" "load_val_f32" (func $load_val_f32 (param i32 f32) (result f32)))
- (import "env" "load_val_f64" (func $load_val_f64 (param i32 f64) (result f64)))
- (import "env" "store_ptr" (func $store_ptr (param i32 i32 i64 i64) (result i64)))
- (import "env" "store_val_i32" (func $store_val_i32 (param i32 i32) (result i32)))
- (import "env" "store_val_i64" (func $store_val_i64 (param i32 i64) (result i64)))
- (import "env" "store_val_f32" (func $store_val_f32 (param i32 f32) (result f32)))
- (import "env" "store_val_f64" (func $store_val_f64 (param i32 f64) (result f64)))
- (memory $0 i64 256 256)
- (func $A
- (drop
- (call $load_val_i32
- (i32.const 1)
- (i32.load8_s
- (call $load_ptr
- (i32.const 1)
- (i32.const 1)
- (i64.const 0)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 2)
- (i32.load8_u
- (call $load_ptr
- (i32.const 2)
- (i32.const 1)
- (i64.const 0)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 3)
- (i32.load16_s
- (call $load_ptr
- (i32.const 3)
- (i32.const 2)
- (i64.const 0)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 4)
- (i32.load16_u
- (call $load_ptr
- (i32.const 4)
- (i32.const 2)
- (i64.const 0)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 5)
- (i32.load
- (call $load_ptr
- (i32.const 5)
- (i32.const 4)
- (i64.const 0)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 6)
- (i64.load8_s
- (call $load_ptr
- (i32.const 6)
- (i32.const 1)
- (i64.const 0)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 7)
- (i64.load8_u
- (call $load_ptr
- (i32.const 7)
- (i32.const 1)
- (i64.const 0)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 8)
- (i64.load16_s
- (call $load_ptr
- (i32.const 8)
- (i32.const 2)
- (i64.const 0)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 9)
- (i64.load16_u
- (call $load_ptr
- (i32.const 9)
- (i32.const 2)
- (i64.const 0)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 10)
- (i64.load32_s
- (call $load_ptr
- (i32.const 10)
- (i32.const 4)
- (i64.const 0)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 11)
- (i64.load32_u
- (call $load_ptr
- (i32.const 11)
- (i32.const 4)
- (i64.const 0)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 12)
- (i64.load
- (call $load_ptr
- (i32.const 12)
- (i32.const 8)
- (i64.const 0)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_f32
- (i32.const 13)
- (f32.load
- (call $load_ptr
- (i32.const 13)
- (i32.const 4)
- (i64.const 0)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_f64
- (i32.const 14)
- (f64.load
- (call $load_ptr
- (i32.const 14)
- (i32.const 8)
- (i64.const 0)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 15)
- (i32.load8_s offset=1
- (call $load_ptr
- (i32.const 15)
- (i32.const 1)
- (i64.const 1)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 16)
- (i32.load8_u offset=2
- (call $load_ptr
- (i32.const 16)
- (i32.const 1)
- (i64.const 2)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 17)
- (i32.load16_s offset=3 align=1
- (call $load_ptr
- (i32.const 17)
- (i32.const 2)
- (i64.const 3)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 18)
- (i32.load16_u offset=4 align=1
- (call $load_ptr
- (i32.const 18)
- (i32.const 2)
- (i64.const 4)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i32
- (i32.const 19)
- (i32.load offset=5 align=2
- (call $load_ptr
- (i32.const 19)
- (i32.const 4)
- (i64.const 5)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 20)
- (i64.load8_s offset=6
- (call $load_ptr
- (i32.const 20)
- (i32.const 1)
- (i64.const 6)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 21)
- (i64.load8_u offset=7
- (call $load_ptr
- (i32.const 21)
- (i32.const 1)
- (i64.const 7)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 22)
- (i64.load16_s offset=8 align=1
- (call $load_ptr
- (i32.const 22)
- (i32.const 2)
- (i64.const 8)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 23)
- (i64.load16_u offset=9 align=1
- (call $load_ptr
- (i32.const 23)
- (i32.const 2)
- (i64.const 9)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 24)
- (i64.load32_s offset=10 align=2
- (call $load_ptr
- (i32.const 24)
- (i32.const 4)
- (i64.const 10)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 25)
- (i64.load32_u offset=11 align=2
- (call $load_ptr
- (i32.const 25)
- (i32.const 4)
- (i64.const 11)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_i64
- (i32.const 26)
- (i64.load offset=12 align=2
- (call $load_ptr
- (i32.const 26)
- (i32.const 8)
- (i64.const 12)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_f32
- (i32.const 27)
- (f32.load offset=13 align=2
- (call $load_ptr
- (i32.const 27)
- (i32.const 4)
- (i64.const 13)
- (i64.const 0)
- )
- )
- )
- )
- (drop
- (call $load_val_f64
- (i32.const 28)
- (f64.load offset=14 align=2
- (call $load_ptr
- (i32.const 28)
- (i32.const 8)
- (i64.const 14)
- (i64.const 0)
- )
- )
- )
- )
- )
- (func $B
- (i32.store8
- (call $store_ptr
- (i32.const 29)
- (i32.const 1)
- (i64.const 0)
- (i64.const 0)
- )
- (call $store_val_i32
- (i32.const 29)
- (i32.const 1)
- )
- )
- (i32.store16
- (call $store_ptr
- (i32.const 30)
- (i32.const 2)
- (i64.const 0)
- (i64.const 0)
- )
- (call $store_val_i32
- (i32.const 30)
- (i32.const 2)
- )
- )
- (i32.store
- (call $store_ptr
- (i32.const 31)
- (i32.const 4)
- (i64.const 0)
- (i64.const 0)
- )
- (call $store_val_i32
- (i32.const 31)
- (i32.const 3)
- )
- )
- (i64.store8
- (call $store_ptr
- (i32.const 32)
- (i32.const 1)
- (i64.const 0)
- (i64.const 0)
- )
- (call $store_val_i64
- (i32.const 32)
- (i64.const 4)
- )
- )
- (i64.store16
- (call $store_ptr
- (i32.const 33)
- (i32.const 2)
- (i64.const 0)
- (i64.const 0)
- )
- (call $store_val_i64
- (i32.const 33)
- (i64.const 5)
- )
- )
- (i64.store32
- (call $store_ptr
- (i32.const 34)
- (i32.const 4)
- (i64.const 0)
- (i64.const 0)
- )
- (call $store_val_i64
- (i32.const 34)
- (i64.const 6)
- )
- )
- (i64.store
- (call $store_ptr
- (i32.const 35)
- (i32.const 8)
- (i64.const 0)
- (i64.const 0)
- )
- (call $store_val_i64
- (i32.const 35)
- (i64.const 7)
- )
- )
- (f32.store
- (call $store_ptr
- (i32.const 36)
- (i32.const 4)
- (i64.const 0)
- (i64.const 0)
- )
- (call $store_val_f32
- (i32.const 36)
- (f32.const 8)
- )
- )
- (f64.store
- (call $store_ptr
- (i32.const 37)
- (i32.const 8)
- (i64.const 0)
- (i64.const 0)
- )
- (call $store_val_f64
- (i32.const 37)
- (f64.const 9)
- )
- )
- (i32.store8 offset=1
- (call $store_ptr
- (i32.const 38)
- (i32.const 1)
- (i64.const 1)
- (i64.const 0)
- )
- (call $store_val_i32
- (i32.const 38)
- (i32.const 1)
- )
- )
- (i32.store16 offset=2 align=1
- (call $store_ptr
- (i32.const 39)
- (i32.const 2)
- (i64.const 2)
- (i64.const 0)
- )
- (call $store_val_i32
- (i32.const 39)
- (i32.const 2)
- )
- )
- (i32.store offset=3 align=2
- (call $store_ptr
- (i32.const 40)
- (i32.const 4)
- (i64.const 3)
- (i64.const 0)
- )
- (call $store_val_i32
- (i32.const 40)
- (i32.const 3)
- )
- )
- (i64.store8 offset=4
- (call $store_ptr
- (i32.const 41)
- (i32.const 1)
- (i64.const 4)
- (i64.const 0)
- )
- (call $store_val_i64
- (i32.const 41)
- (i64.const 4)
- )
- )
- (i64.store16 offset=5
- (call $store_ptr
- (i32.const 42)
- (i32.const 2)
- (i64.const 5)
- (i64.const 0)
- )
- (call $store_val_i64
- (i32.const 42)
- (i64.const 5)
- )
- )
- (i64.store32 offset=6 align=2
- (call $store_ptr
- (i32.const 43)
- (i32.const 4)
- (i64.const 6)
- (i64.const 0)
- )
- (call $store_val_i64
- (i32.const 43)
- (i64.const 6)
- )
- )
- (i64.store offset=7 align=2
- (call $store_ptr
- (i32.const 44)
- (i32.const 8)
- (i64.const 7)
- (i64.const 0)
- )
- (call $store_val_i64
- (i32.const 44)
- (i64.const 7)
- )
- )
- (f32.store offset=8 align=2
- (call $store_ptr
- (i32.const 45)
- (i32.const 4)
- (i64.const 8)
- (i64.const 0)
- )
- (call $store_val_f32
- (i32.const 45)
- (f32.const 8)
- )
- )
- (f64.store offset=9 align=2
- (call $store_ptr
- (i32.const 46)
- (i32.const 8)
- (i64.const 9)
- (i64.const 0)
- )
- (call $store_val_f64
- (i32.const 46)
- (f64.const 9)
- )
- )
- )
-)
diff --git a/test/passes/instrument-memory64.wast b/test/passes/instrument-memory64.wast
deleted file mode 100644
index 1524b87f3..000000000
--- a/test/passes/instrument-memory64.wast
+++ /dev/null
@@ -1,57 +0,0 @@
-(module
- (memory i64 256 256)
- (type $1 (func))
- (func $A (type $1)
- (drop (i32.load8_s (i64.const 0)))
- (drop (i32.load8_u (i64.const 0)))
- (drop (i32.load16_s (i64.const 0)))
- (drop (i32.load16_u (i64.const 0)))
- (drop (i32.load (i64.const 0)))
- (drop (i64.load8_s (i64.const 0)))
- (drop (i64.load8_u (i64.const 0)))
- (drop (i64.load16_s (i64.const 0)))
- (drop (i64.load16_u (i64.const 0)))
- (drop (i64.load32_s (i64.const 0)))
- (drop (i64.load32_u (i64.const 0)))
- (drop (i64.load (i64.const 0)))
- (drop (f32.load (i64.const 0)))
- (drop (f64.load (i64.const 0)))
-
- (drop (i32.load8_s align=1 offset=1 (i64.const 0)))
- (drop (i32.load8_u align=1 offset=2 (i64.const 0)))
- (drop (i32.load16_s align=1 offset=3 (i64.const 0)))
- (drop (i32.load16_u align=1 offset=4 (i64.const 0)))
- (drop (i32.load align=2 offset=5 (i64.const 0)))
- (drop (i64.load8_s align=1 offset=6 (i64.const 0)))
- (drop (i64.load8_u align=1 offset=7 (i64.const 0)))
- (drop (i64.load16_s align=1 offset=8 (i64.const 0)))
- (drop (i64.load16_u align=1 offset=9 (i64.const 0)))
- (drop (i64.load32_s align=2 offset=10 (i64.const 0)))
- (drop (i64.load32_u align=2 offset=11 (i64.const 0)))
- (drop (i64.load align=2 offset=12 (i64.const 0)))
- (drop (f32.load align=2 offset=13 (i64.const 0)))
- (drop (f64.load align=2 offset=14 (i64.const 0)))
- )
-
- (func $B (type $1)
- (i32.store8 (i64.const 0) (i32.const 1))
- (i32.store16 (i64.const 0) (i32.const 2))
- (i32.store (i64.const 0) (i32.const 3))
- (i64.store8 (i64.const 0) (i64.const 4))
- (i64.store16 (i64.const 0) (i64.const 5))
- (i64.store32 (i64.const 0) (i64.const 6))
- (i64.store (i64.const 0) (i64.const 7))
- (f32.store (i64.const 0) (f32.const 8))
- (f64.store (i64.const 0) (f64.const 9))
-
- (i32.store8 align=1 offset=1 (i64.const 0) (i32.const 1))
- (i32.store16 align=1 offset=2 (i64.const 0) (i32.const 2))
- (i32.store align=2 offset=3 (i64.const 0) (i32.const 3))
- (i64.store8 align=1 offset=4 (i64.const 0) (i64.const 4))
- (i64.store16 align=2 offset=5 (i64.const 0) (i64.const 5))
- (i64.store32 align=2 offset=6 (i64.const 0) (i64.const 6))
- (i64.store align=2 offset=7 (i64.const 0) (i64.const 7))
- (f32.store align=2 offset=8 (i64.const 0) (f32.const 8))
- (f64.store align=2 offset=9 (i64.const 0) (f64.const 9))
- )
-)