summaryrefslogtreecommitdiff
path: root/test/passes
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes')
-rw-r--r--test/passes/duplicate-function-elimination_all-features.txt10
-rw-r--r--test/passes/duplicate-function-elimination_all-features.wast12
-rw-r--r--test/passes/flatten_all-features.txt (renamed from test/passes/flatten.txt)48
-rw-r--r--test/passes/flatten_all-features.wast (renamed from test/passes/flatten.wast)20
-rw-r--r--test/passes/flatten_local-cse_all-features.txt (renamed from test/passes/flatten_local-cse.txt)29
-rw-r--r--test/passes/flatten_local-cse_all-features.wast (renamed from test/passes/flatten_local-cse.wast)12
-rw-r--r--test/passes/inlining_all-features.txt16
-rw-r--r--test/passes/inlining_all-features.wast10
-rw-r--r--test/passes/instrument-locals_all-features.txt174
-rw-r--r--test/passes/instrument-locals_all-features.wast38
-rw-r--r--test/passes/legalize-js-interface_all-features.txt (renamed from test/passes/legalize-js-interface.txt)39
-rw-r--r--test/passes/legalize-js-interface_all-features.wast (renamed from test/passes/legalize-js-interface.wast)13
-rw-r--r--test/passes/merge-locals_all-features.txt (renamed from test/passes/merge-locals.txt)12
-rw-r--r--test/passes/merge-locals_all-features.wast (renamed from test/passes/merge-locals.wast)12
-rw-r--r--test/passes/optimize-instructions_all-features.txt (renamed from test/passes/optimize-instructions_enable-threads.txt)6
-rw-r--r--test/passes/optimize-instructions_all-features.wast (renamed from test/passes/optimize-instructions_enable-threads.wast)10
-rw-r--r--test/passes/precompute_all-features.txt4
-rw-r--r--test/passes/precompute_all-features.wast4
-rw-r--r--test/passes/remove-unused-module-elements_all-features.txt12
-rw-r--r--test/passes/remove-unused-module-elements_all-features.wast9
-rw-r--r--test/passes/simplify-globals-optimizing_enable-mutable-globals.wast1
-rw-r--r--test/passes/simplify-globals_all-features.txt (renamed from test/passes/simplify-globals_enable-mutable-globals.txt)19
-rw-r--r--test/passes/simplify-globals_all-features.wast (renamed from test/passes/simplify-globals_enable-mutable-globals.wast)14
-rw-r--r--test/passes/simplify-locals_all-features.txt13
-rw-r--r--test/passes/simplify-locals_all-features.wast16
-rw-r--r--test/passes/translate-to-fuzz_all-features.txt1534
-rw-r--r--test/passes/translate-to-fuzz_no-fuzz-nans_all-features.txt830
27 files changed, 2107 insertions, 810 deletions
diff --git a/test/passes/duplicate-function-elimination_all-features.txt b/test/passes/duplicate-function-elimination_all-features.txt
new file mode 100644
index 000000000..edb6e7e1f
--- /dev/null
+++ b/test/passes/duplicate-function-elimination_all-features.txt
@@ -0,0 +1,10 @@
+(module
+ (type $none_=>_i32 (func (result i32)))
+ (type $none_=>_funcref (func (result funcref)))
+ (func $0 (; 0 ;) (result i32)
+ (i32.const 0)
+ )
+ (func $test (; 1 ;) (result funcref)
+ (ref.func $0)
+ )
+)
diff --git a/test/passes/duplicate-function-elimination_all-features.wast b/test/passes/duplicate-function-elimination_all-features.wast
new file mode 100644
index 000000000..587271728
--- /dev/null
+++ b/test/passes/duplicate-function-elimination_all-features.wast
@@ -0,0 +1,12 @@
+;; --dupliate-function-elimination should not remove functions used in ref.func.
+(module
+ (func $0 (result i32)
+ (i32.const 0)
+ )
+ (func $1 (result i32)
+ (i32.const 0)
+ )
+ (func $test (result funcref)
+ (ref.func $1)
+ )
+)
diff --git a/test/passes/flatten.txt b/test/passes/flatten_all-features.txt
index 7d7eb80dd..38dc9bdfe 100644
--- a/test/passes/flatten.txt
+++ b/test/passes/flatten_all-features.txt
@@ -5,6 +5,7 @@
(type $i32_=>_i32 (func (param i32) (result i32)))
(type $none_=>_f32 (func (result f32)))
(type $i64_i64_=>_i64 (func (param i64 i64) (result i64)))
+ (type $none_=>_anyref (func (result anyref)))
(memory $0 10)
(table $0 1 1 funcref)
(elem (i32.const 0) $call-me)
@@ -2312,4 +2313,51 @@
)
(unreachable)
)
+ (func $subtype (; 43 ;) (result anyref)
+ (local $0 nullref)
+ (local $1 anyref)
+ (local $2 nullref)
+ (local $3 nullref)
+ (local $4 nullref)
+ (local $5 nullref)
+ (local $6 nullref)
+ (local $7 anyref)
+ (block $label0
+ (block $block
+ (local.set $1
+ (ref.null)
+ )
+ (local.set $2
+ (ref.null)
+ )
+ (br_if $label0
+ (i32.const 0)
+ )
+ (local.set $3
+ (local.get $2)
+ )
+ (local.set $0
+ (local.get $3)
+ )
+ (local.set $4
+ (local.get $0)
+ )
+ (local.set $5
+ (local.get $4)
+ )
+ )
+ (local.set $6
+ (local.get $5)
+ )
+ (local.set $1
+ (local.get $6)
+ )
+ )
+ (local.set $7
+ (local.get $1)
+ )
+ (return
+ (local.get $7)
+ )
+ )
)
diff --git a/test/passes/flatten.wast b/test/passes/flatten_all-features.wast
index dbfc8165c..fe8629e73 100644
--- a/test/passes/flatten.wast
+++ b/test/passes/flatten_all-features.wast
@@ -1019,4 +1019,24 @@
(func $return (param $x i32) (result i32)
(return (i32.sub (i32.const 1) (i32.const 2)))
)
+
+ ;; subtypes
+
+ ;; br_if leaves a value on the stack if not taken, which later can be the last
+ ;; element of the enclosing innermost block and flow out. So in case br_if
+ ;; targets an outer branch whose return type is a supertype of the br_if's
+ ;; value type, we need the value to be set into two locals: one with the outer
+ ;; block's type, and one with its value type.
+ (func $subtype (result anyref) (local $0 nullref)
+ (block $label0 (result anyref)
+ (block (result nullref)
+ (local.tee $0
+ (br_if $label0
+ (ref.null)
+ (i32.const 0)
+ )
+ )
+ )
+ )
+ )
)
diff --git a/test/passes/flatten_local-cse.txt b/test/passes/flatten_local-cse_all-features.txt
index f576ccefe..0697e27a5 100644
--- a/test/passes/flatten_local-cse.txt
+++ b/test/passes/flatten_local-cse_all-features.txt
@@ -761,3 +761,32 @@
)
)
)
+(module
+ (type $none_=>_funcref (func (result funcref)))
+ (func $subtype-test (; 0 ;) (result funcref)
+ (local $0 nullref)
+ (local $1 nullref)
+ (local $2 funcref)
+ (local $3 funcref)
+ (block
+ (nop)
+ (loop $label$1
+ (local.set $0
+ (ref.null)
+ )
+ )
+ (local.set $1
+ (local.get $0)
+ )
+ (local.set $2
+ (local.get $0)
+ )
+ )
+ (local.set $3
+ (local.get $2)
+ )
+ (return
+ (local.get $2)
+ )
+ )
+)
diff --git a/test/passes/flatten_local-cse.wast b/test/passes/flatten_local-cse_all-features.wast
index b967e9177..6ca154278 100644
--- a/test/passes/flatten_local-cse.wast
+++ b/test/passes/flatten_local-cse_all-features.wast
@@ -287,3 +287,15 @@
(local.set $y (global.get $glob))
)
)
+
+;; After --flatten, there will be a series of chain copies between multiple
+;; locals, but some of the locals will be nullref type and others funcref type.
+;; We cannot make locals of different types a common subexpression.
+(module
+ (func $subtype-test (result funcref)
+ (nop)
+ (loop $label$1 (result nullref)
+ (ref.null)
+ )
+ )
+)
diff --git a/test/passes/inlining_all-features.txt b/test/passes/inlining_all-features.txt
new file mode 100644
index 000000000..ec99a3603
--- /dev/null
+++ b/test/passes/inlining_all-features.txt
@@ -0,0 +1,16 @@
+(module
+ (type $none_=>_none (func))
+ (type $none_=>_funcref (func (result funcref)))
+ (export "test" (func $test))
+ (func $foo (; 0 ;)
+ (nop)
+ )
+ (func $test (; 1 ;) (result funcref)
+ (block
+ (block $__inlined_func$foo
+ (nop)
+ )
+ )
+ (ref.func $foo)
+ )
+)
diff --git a/test/passes/inlining_all-features.wast b/test/passes/inlining_all-features.wast
new file mode 100644
index 000000000..352978eda
--- /dev/null
+++ b/test/passes/inlining_all-features.wast
@@ -0,0 +1,10 @@
+(module
+ (export "test" (func $test))
+ ;; $foo should not be removed after being inlined, because there is 'ref.func'
+ ;; instruction that refers to it
+ (func $foo)
+ (func $test (result funcref)
+ (call $foo)
+ (ref.func $foo)
+ )
+)
diff --git a/test/passes/instrument-locals_all-features.txt b/test/passes/instrument-locals_all-features.txt
index 92924611c..efda489bd 100644
--- a/test/passes/instrument-locals_all-features.txt
+++ b/test/passes/instrument-locals_all-features.txt
@@ -3,7 +3,9 @@
(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_anyref_=>_anyref (func (param i32 i32 anyref) (result anyref)))
+ (type $i32_i32_nullref_=>_nullref (func (param i32 i32 nullref) (result nullref)))
(type $i32_i32_exnref_=>_exnref (func (param i32 i32 exnref) (result exnref)))
(type $none_=>_none (func))
(import "env" "get_i32" (func $get_i32 (param i32 i32 i32) (result i32)))
@@ -14,17 +16,23 @@
(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_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_nullref" (func $get_nullref (param i32 i32 nullref) (result nullref)))
+ (import "env" "set_nullref" (func $set_nullref (param i32 i32 nullref) (result nullref)))
(import "env" "get_exnref" (func $get_exnref (param i32 i32 exnref) (result exnref)))
(import "env" "set_exnref" (func $set_exnref (param i32 i32 exnref) (result exnref)))
- (func $A (; 12 ;)
+ (func $test (; 16 ;)
(local $x i32)
(local $y i64)
(local $z f32)
(local $w f64)
- (local $a anyref)
- (local $e exnref)
+ (local $F funcref)
+ (local $A anyref)
+ (local $N nullref)
+ (local $E exnref)
(drop
(call $get_i32
(i32.const 0)
@@ -50,22 +58,36 @@
)
)
(drop
- (call $get_anyref
+ (call $get_funcref
(i32.const 3)
(i32.const 4)
- (local.get $a)
+ (local.get $F)
)
)
(drop
- (call $get_exnref
+ (call $get_anyref
(i32.const 4)
(i32.const 5)
- (local.get $e)
+ (local.get $A)
)
)
(drop
- (call $get_i32
+ (call $get_nullref
(i32.const 5)
+ (i32.const 6)
+ (local.get $N)
+ )
+ )
+ (drop
+ (call $get_exnref
+ (i32.const 6)
+ (i32.const 7)
+ (local.get $E)
+ )
+ )
+ (drop
+ (call $get_i32
+ (i32.const 7)
(i32.const 0)
(local.get $x)
)
@@ -75,35 +97,49 @@
)
(drop
(call $get_f32
- (i32.const 6)
+ (i32.const 8)
(i32.const 2)
(local.get $z)
)
)
(drop
(call $get_f64
- (i32.const 7)
+ (i32.const 9)
(i32.const 3)
(local.get $w)
)
)
(drop
- (call $get_anyref
- (i32.const 8)
+ (call $get_funcref
+ (i32.const 10)
(i32.const 4)
- (local.get $a)
+ (local.get $F)
)
)
(drop
- (call $get_exnref
- (i32.const 9)
+ (call $get_anyref
+ (i32.const 11)
(i32.const 5)
- (local.get $e)
+ (local.get $A)
+ )
+ )
+ (drop
+ (call $get_nullref
+ (i32.const 12)
+ (i32.const 6)
+ (local.get $N)
+ )
+ )
+ (drop
+ (call $get_exnref
+ (i32.const 13)
+ (i32.const 7)
+ (local.get $E)
)
)
(local.set $x
(call $set_i32
- (i32.const 10)
+ (i32.const 14)
(i32.const 0)
(i32.const 1)
)
@@ -113,43 +149,57 @@
)
(local.set $z
(call $set_f32
- (i32.const 11)
+ (i32.const 15)
(i32.const 2)
(f32.const 3.2100000381469727)
)
)
(local.set $w
(call $set_f64
- (i32.const 12)
+ (i32.const 16)
(i32.const 3)
(f64.const 4.321)
)
)
- (local.set $a
- (call $set_anyref
- (i32.const 14)
+ (local.set $F
+ (call $set_funcref
+ (i32.const 17)
(i32.const 4)
+ (ref.func $test)
+ )
+ )
+ (local.set $A
+ (call $set_anyref
+ (i32.const 19)
+ (i32.const 5)
(call $get_anyref
- (i32.const 13)
- (i32.const 4)
- (local.get $a)
+ (i32.const 18)
+ (i32.const 5)
+ (local.get $A)
)
)
)
- (local.set $e
+ (local.set $N
+ (call $set_nullref
+ (i32.const 20)
+ (i32.const 6)
+ (ref.null)
+ )
+ )
+ (local.set $E
(call $set_exnref
- (i32.const 16)
- (i32.const 5)
+ (i32.const 22)
+ (i32.const 7)
(call $get_exnref
- (i32.const 15)
- (i32.const 5)
- (local.get $e)
+ (i32.const 21)
+ (i32.const 7)
+ (local.get $E)
)
)
)
(local.set $x
(call $set_i32
- (i32.const 17)
+ (i32.const 23)
(i32.const 0)
(i32.const 11)
)
@@ -159,44 +209,72 @@
)
(local.set $z
(call $set_f32
- (i32.const 18)
+ (i32.const 24)
(i32.const 2)
(f32.const 33.209999084472656)
)
)
(local.set $w
(call $set_f64
- (i32.const 19)
+ (i32.const 25)
(i32.const 3)
(f64.const 44.321)
)
)
- (local.set $a
- (call $set_anyref
- (i32.const 21)
+ (local.set $F
+ (call $set_funcref
+ (i32.const 27)
(i32.const 4)
- (call $get_anyref
- (i32.const 20)
+ (call $get_funcref
+ (i32.const 26)
(i32.const 4)
- (local.get $a)
+ (local.get $F)
)
)
)
- (local.set $e
- (call $set_exnref
- (i32.const 23)
+ (local.set $A
+ (call $set_anyref
+ (i32.const 29)
(i32.const 5)
- (call $get_exnref
- (i32.const 22)
+ (call $get_anyref
+ (i32.const 28)
(i32.const 5)
- (local.get $e)
+ (local.get $A)
+ )
+ )
+ )
+ (local.set $N
+ (call $set_nullref
+ (i32.const 31)
+ (i32.const 6)
+ (call $get_nullref
+ (i32.const 30)
+ (i32.const 6)
+ (local.get $N)
+ )
+ )
+ )
+ (local.set $E
+ (call $set_exnref
+ (i32.const 33)
+ (i32.const 7)
+ (call $get_exnref
+ (i32.const 32)
+ (i32.const 7)
+ (local.get $E)
)
)
)
- (local.set $a
+ (local.set $F
+ (funcref.pop)
+ )
+ (local.set $A
(anyref.pop)
)
- (local.set $e
+ (local.set $N
+ (nullref.pop)
+ )
+ (local.set $E
(exnref.pop)
)
)
diff --git a/test/passes/instrument-locals_all-features.wast b/test/passes/instrument-locals_all-features.wast
index 906366557..ccf64d5a2 100644
--- a/test/passes/instrument-locals_all-features.wast
+++ b/test/passes/instrument-locals_all-features.wast
@@ -1,43 +1,55 @@
(module
- (func $A
+ (func $test
(local $x i32)
(local $y i64)
(local $z f32)
(local $w f64)
- (local $a anyref)
- (local $e exnref)
+ (local $F funcref)
+ (local $A anyref)
+ (local $N nullref)
+ (local $E exnref)
(drop (local.get $x))
(drop (local.get $y))
(drop (local.get $z))
(drop (local.get $w))
- (drop (local.get $a))
- (drop (local.get $e))
+ (drop (local.get $F))
+ (drop (local.get $A))
+ (drop (local.get $N))
+ (drop (local.get $E))
(drop (local.get $x))
(drop (local.get $y))
(drop (local.get $z))
(drop (local.get $w))
- (drop (local.get $a))
- (drop (local.get $e))
+ (drop (local.get $F))
+ (drop (local.get $A))
+ (drop (local.get $N))
+ (drop (local.get $E))
(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 $a (local.get $a))
- (local.set $e (local.get $e))
+ (local.set $F (ref.func $test))
+ (local.set $A (local.get $A))
+ (local.set $N (ref.null))
+ (local.set $E (local.get $E))
(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 $a (local.get $a))
- (local.set $e (local.get $e))
+ (local.set $F (local.get $F))
+ (local.set $A (local.get $A))
+ (local.set $N (local.get $N))
+ (local.set $E (local.get $E))
;; Pop instructions should not be instrumented
- (local.set $a (anyref.pop))
- (local.set $e (exnref.pop))
+ (local.set $F (funcref.pop))
+ (local.set $A (anyref.pop))
+ (local.set $N (nullref.pop))
+ (local.set $E (exnref.pop))
)
)
diff --git a/test/passes/legalize-js-interface.txt b/test/passes/legalize-js-interface_all-features.txt
index 4e27eff5c..866356947 100644
--- a/test/passes/legalize-js-interface.txt
+++ b/test/passes/legalize-js-interface_all-features.txt
@@ -1,18 +1,22 @@
(module
(type $none_=>_i32 (func (result i32)))
- (type $i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32)))
(type $none_=>_i64 (func (result i64)))
+ (type $i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32)))
+ (type $none_=>_none (func))
(type $i32_=>_none (func (param i32)))
(type $i32_i64_i64_=>_none (func (param i32 i64 i64)))
+ (import "env" "ref-func-arg" (func $ref-func-arg (result i64)))
(import "env" "setTempRet0" (func $setTempRet0 (param i32)))
(import "env" "getTempRet0" (func $getTempRet0 (result i32)))
(import "env" "imported" (func $legalimport$imported (result i32)))
(import "env" "other" (func $legalimport$other (param i32 i32 i32 i32 i32)))
+ (import "env" "ref-func-arg" (func $legalimport$ref-func-arg (result i32)))
(export "func" (func $legalstub$func))
+ (export "ref-func-test" (func $ref-func-test))
(export "imported" (func $legalstub$imported))
(export "imported_again" (func $legalstub$imported))
(export "other" (func $legalstub$other))
- (func $func (; 4 ;) (result i64)
+ (func $func (; 6 ;) (result i64)
(drop
(call $legalfunc$imported)
)
@@ -23,7 +27,15 @@
)
(unreachable)
)
- (func $legalstub$func (; 5 ;) (result i32)
+ (func $ref-func-test (; 7 ;)
+ (drop
+ (call $legalfunc$ref-func-arg)
+ )
+ (drop
+ (ref.func $ref-func-arg)
+ )
+ )
+ (func $legalstub$func (; 8 ;) (result i32)
(local $0 i64)
(local.set $0
(call $func)
@@ -40,7 +52,7 @@
(local.get $0)
)
)
- (func $legalstub$imported (; 6 ;) (result i32)
+ (func $legalstub$imported (; 9 ;) (result i32)
(local $0 i64)
(local.set $0
(call $legalfunc$imported)
@@ -57,7 +69,7 @@
(local.get $0)
)
)
- (func $legalstub$other (; 7 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32)
+ (func $legalstub$other (; 10 ;) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32)
(call $legalfunc$other
(local.get $0)
(i64.or
@@ -84,7 +96,7 @@
)
)
)
- (func $legalfunc$imported (; 8 ;) (result i64)
+ (func $legalfunc$imported (; 11 ;) (result i64)
(i64.or
(i64.extend_i32_u
(call $legalimport$imported)
@@ -97,7 +109,7 @@
)
)
)
- (func $legalfunc$other (; 9 ;) (param $0 i32) (param $1 i64) (param $2 i64)
+ (func $legalfunc$other (; 12 ;) (param $0 i32) (param $1 i64) (param $2 i64)
(call $legalimport$other
(local.get $0)
(i32.wrap_i64
@@ -120,6 +132,19 @@
)
)
)
+ (func $legalfunc$ref-func-arg (; 13 ;) (result i64)
+ (i64.or
+ (i64.extend_i32_u
+ (call $legalimport$ref-func-arg)
+ )
+ (i64.shl
+ (i64.extend_i32_u
+ (call $getTempRet0)
+ )
+ (i64.const 32)
+ )
+ )
+ )
)
(module
)
diff --git a/test/passes/legalize-js-interface.wast b/test/passes/legalize-js-interface_all-features.wast
index da8a0b2ff..4697a8f18 100644
--- a/test/passes/legalize-js-interface.wast
+++ b/test/passes/legalize-js-interface_all-features.wast
@@ -1,7 +1,9 @@
(module
(import "env" "imported" (func $imported (result i64)))
(import "env" "other" (func $other (param i32) (param i64) (param i64)))
+ (import "env" "ref-func-arg" (func $ref-func-arg (result i64)))
(export "func" (func $func))
+ (export "ref-func-test" (func $ref-func-test))
(export "imported" (func $imported))
(export "imported_again" (func $imported))
(export "other" (func $other))
@@ -14,5 +16,16 @@
)
(unreachable)
)
+
+ ;; If an import is used in ref.func, even if it is legalized to another
+ ;; import, the original import should not be removed.
+ (func $ref-func-test
+ (drop
+ (call $ref-func-arg)
+ )
+ (drop
+ (ref.func $ref-func-arg)
+ )
+ )
)
(module)
diff --git a/test/passes/merge-locals.txt b/test/passes/merge-locals_all-features.txt
index f955cec33..1210fab59 100644
--- a/test/passes/merge-locals.txt
+++ b/test/passes/merge-locals_all-features.txt
@@ -1,6 +1,7 @@
(module
(type $i32_i32_=>_none (func (param i32 i32)))
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
+ (type $none_=>_none (func))
(type $i32_i32_i32_=>_none (func (param i32 i32 i32)))
(type $i32_f32_f32_=>_i64 (func (param i32 f32 f32) (result i64)))
(global $global$0 (mut i32) (i32.const 10))
@@ -456,4 +457,15 @@
)
)
)
+ (func $subtype-test (; 20 ;)
+ (local $0 anyref)
+ (local $1 nullref)
+ (local $2 nullref)
+ (local.set $0
+ (local.get $1)
+ )
+ (local.set $2
+ (local.get $1)
+ )
+ )
)
diff --git a/test/passes/merge-locals.wast b/test/passes/merge-locals_all-features.wast
index c47dfd125..a7f61796a 100644
--- a/test/passes/merge-locals.wast
+++ b/test/passes/merge-locals_all-features.wast
@@ -375,5 +375,17 @@
)
)
)
+ (func $subtype-test
+ (local $0 anyref)
+ (local $1 nullref)
+ (local $2 nullref)
+ (local.set $0
+ (local.get $1)
+ )
+ (local.set $2
+ ;; This should NOT become $0, because types of $0 and $1 are different
+ (local.get $1)
+ )
+ )
)
diff --git a/test/passes/optimize-instructions_enable-threads.txt b/test/passes/optimize-instructions_all-features.txt
index 8f9ee1843..53c28e896 100644
--- a/test/passes/optimize-instructions_enable-threads.txt
+++ b/test/passes/optimize-instructions_all-features.txt
@@ -3337,3 +3337,9 @@
)
)
)
+(module
+ (type $none_=>_anyref (func (result anyref)))
+ (func $test (; 0 ;) (result anyref)
+ (ref.null)
+ )
+)
diff --git a/test/passes/optimize-instructions_enable-threads.wast b/test/passes/optimize-instructions_all-features.wast
index 243cb79d7..75993effa 100644
--- a/test/passes/optimize-instructions_enable-threads.wast
+++ b/test/passes/optimize-instructions_all-features.wast
@@ -3783,3 +3783,13 @@
)
)
)
+(module
+ ;; Tests when if arms are subtype of if's type
+ (func $test (result anyref)
+ (if (result anyref)
+ (i32.const 0)
+ (ref.null)
+ (ref.null)
+ )
+ )
+)
diff --git a/test/passes/precompute_all-features.txt b/test/passes/precompute_all-features.txt
index 901757b99..b24c96159 100644
--- a/test/passes/precompute_all-features.txt
+++ b/test/passes/precompute_all-features.txt
@@ -4,6 +4,7 @@
(type $none_=>_f64 (func (result f64)))
(type $none_=>_v128 (func (result v128)))
(type $i32_=>_none (func (param i32)))
+ (type $none_=>_nullref (func (result nullref)))
(memory $0 512 512)
(data (i32.const 0) "passive")
(global $global i32 (i32.const 1))
@@ -249,4 +250,7 @@
(i32.const 12)
)
)
+ (func $reftype-test (; 17 ;) (result nullref)
+ (ref.null)
+ )
)
diff --git a/test/passes/precompute_all-features.wast b/test/passes/precompute_all-features.wast
index 28c570b7a..74b8f1317 100644
--- a/test/passes/precompute_all-features.wast
+++ b/test/passes/precompute_all-features.wast
@@ -344,4 +344,8 @@
(i32.const 12)
)
)
+ ;; Check if Precompute pass does not crash on reference types
+ (func $reftype-test (result nullref)
+ (ref.null)
+ )
)
diff --git a/test/passes/remove-unused-module-elements_all-features.txt b/test/passes/remove-unused-module-elements_all-features.txt
index eb5d177dd..8d5c4a2b6 100644
--- a/test/passes/remove-unused-module-elements_all-features.txt
+++ b/test/passes/remove-unused-module-elements_all-features.txt
@@ -310,3 +310,15 @@
)
)
)
+(module
+ (type $none_=>_none (func))
+ (export "test" (func $test))
+ (func $foo (; 0 ;)
+ (nop)
+ )
+ (func $test (; 1 ;)
+ (drop
+ (ref.func $foo)
+ )
+ )
+)
diff --git a/test/passes/remove-unused-module-elements_all-features.wast b/test/passes/remove-unused-module-elements_all-features.wast
index 57d376d31..fcde89b3c 100644
--- a/test/passes/remove-unused-module-elements_all-features.wast
+++ b/test/passes/remove-unused-module-elements_all-features.wast
@@ -286,3 +286,12 @@
)
)
)
+(module ;; functions referenced by ref.func cannot be removed
+ (export "test" $test)
+ (func $foo)
+ (func $test
+ (drop
+ (ref.func $foo)
+ )
+ )
+)
diff --git a/test/passes/simplify-globals-optimizing_enable-mutable-globals.wast b/test/passes/simplify-globals-optimizing_enable-mutable-globals.wast
index f8a099e95..91ef66ebf 100644
--- a/test/passes/simplify-globals-optimizing_enable-mutable-globals.wast
+++ b/test/passes/simplify-globals-optimizing_enable-mutable-globals.wast
@@ -126,4 +126,3 @@
(global.get $g1)
)
)
-
diff --git a/test/passes/simplify-globals_enable-mutable-globals.txt b/test/passes/simplify-globals_all-features.txt
index 8146bb942..d467925ec 100644
--- a/test/passes/simplify-globals_enable-mutable-globals.txt
+++ b/test/passes/simplify-globals_all-features.txt
@@ -211,3 +211,22 @@
(i32.const 100)
)
)
+(module
+ (type $none_=>_none (func))
+ (import "env" "global-1" (global $g1 anyref))
+ (global $g2 anyref (global.get $g1))
+ (global $g3 anyref (ref.null))
+ (func $test1 (; 0 ;)
+ (drop
+ (global.get $g1)
+ )
+ (drop
+ (global.get $g1)
+ )
+ )
+ (func $test2 (; 1 ;)
+ (drop
+ (ref.null)
+ )
+ )
+)
diff --git a/test/passes/simplify-globals_enable-mutable-globals.wast b/test/passes/simplify-globals_all-features.wast
index f8a099e95..f7470f959 100644
--- a/test/passes/simplify-globals_enable-mutable-globals.wast
+++ b/test/passes/simplify-globals_all-features.wast
@@ -126,4 +126,16 @@
(global.get $g1)
)
)
-
+;; Reference type tests
+(module
+ (import "env" "global-1" (global $g1 anyref))
+ (global $g2 (mut anyref) (global.get $g1))
+ (global $g3 anyref (ref.null))
+ (func $test1
+ (drop (global.get $g1))
+ (drop (global.get $g2))
+ )
+ (func $test2
+ (drop (global.get $g3))
+ )
+)
diff --git a/test/passes/simplify-locals_all-features.txt b/test/passes/simplify-locals_all-features.txt
index 0902a607e..60459d1a8 100644
--- a/test/passes/simplify-locals_all-features.txt
+++ b/test/passes/simplify-locals_all-features.txt
@@ -1873,3 +1873,16 @@
)
)
)
+(module
+ (type $none_=>_funcref (func (result funcref)))
+ (func $subtype-test (; 0 ;) (result funcref)
+ (local $0 nullref)
+ (local $1 funcref)
+ (local $2 funcref)
+ (block $block
+ (nop)
+ )
+ (nop)
+ (local.get $0)
+ )
+)
diff --git a/test/passes/simplify-locals_all-features.wast b/test/passes/simplify-locals_all-features.wast
index ff362db64..a819dda15 100644
--- a/test/passes/simplify-locals_all-features.wast
+++ b/test/passes/simplify-locals_all-features.wast
@@ -1655,3 +1655,19 @@
)
)
)
+(module
+ (func $subtype-test (result funcref)
+ (local $0 nullref)
+ (local $1 funcref)
+ (local $2 funcref)
+ (block
+ (local.set $1
+ (local.get $0)
+ )
+ )
+ (local.set $2
+ (local.get $1)
+ )
+ (local.get $1)
+ )
+)
diff --git a/test/passes/translate-to-fuzz_all-features.txt b/test/passes/translate-to-fuzz_all-features.txt
index 50c7658d8..3255c757d 100644
--- a/test/passes/translate-to-fuzz_all-features.txt
+++ b/test/passes/translate-to-fuzz_all-features.txt
@@ -1,32 +1,69 @@
(module
- (type $none_=>_i32 (func (result i32)))
(type $none_=>_none (func))
+ (type $none_=>_i32 (func (result i32)))
+ (type $none_=>_i64 (func (result i64)))
(type $i32_=>_none (func (param i32)))
(type $i64_=>_none (func (param i64)))
(type $f32_=>_none (func (param f32)))
(type $f64_=>_none (func (param f64)))
- (type $f64_f32_=>_none (func (param f64 f32)))
+ (type $f64_exnref_=>_none (func (param f64 exnref)))
(type $v128_=>_none (func (param v128)))
- (type $f64_i32_=>_v128 (func (param f64 i32) (result v128)))
+ (type $anyref_i64_i32_f32_nullref_exnref_=>_none (func (param anyref i64 i32 f32 nullref exnref)))
+ (type $nullref_=>_none (func (param nullref)))
+ (type $exnref_=>_none (func (param exnref)))
+ (type $exnref_f32_v128_i32_funcref_=>_none (func (param exnref f32 v128 i32 funcref)))
+ (type $i64_=>_i32 (func (param i64) (result i32)))
+ (type $f32_=>_i64 (func (param f32) (result i64)))
+ (type $none_=>_f32 (func (result f32)))
+ (type $none_=>_funcref (func (result funcref)))
+ (type $v128_anyref_i32_i32_=>_funcref (func (param v128 anyref i32 i32) (result funcref)))
+ (type $f64_i32_i64_f64_f32_=>_anyref (func (param f64 i32 i64 f64 f32) (result anyref)))
+ (type $nullref_=>_anyref (func (param nullref) (result anyref)))
+ (type $i32_exnref_exnref_v128_v128_v128_=>_nullref (func (param i32 exnref exnref v128 v128 v128) (result nullref)))
+ (type $f32_v128_v128_f32_=>_nullref (func (param f32 v128 v128 f32) (result nullref)))
+ (type $v128_=>_nullref (func (param v128) (result nullref)))
(import "fuzzing-support" "log-i32" (func $log-i32 (param i32)))
(import "fuzzing-support" "log-i64" (func $log-i64 (param i64)))
(import "fuzzing-support" "log-f32" (func $log-f32 (param f32)))
(import "fuzzing-support" "log-f64" (func $log-f64 (param f64)))
(import "fuzzing-support" "log-v128" (func $log-v128 (param v128)))
- (memory $0 (shared 1 1))
+ (import "fuzzing-support" "log-nullref" (func $log-nullref (param nullref)))
+ (import "fuzzing-support" "log-exnref" (func $log-exnref (param exnref)))
+ (memory $0 1 1)
(data (i32.const 0) "N\0fN\f5\f9\b1\ff\fa\eb\e5\fe\a7\ec\fb\fc\f4\a6\e4\ea\f0\ae\e3")
- (table $0 0 funcref)
+ (table $0 10 10 funcref)
+ (elem (i32.const 0) $func_8 $func_13 $func_13 $func_13 $func_14 $func_15 $func_17 $func_23 $func_23 $func_31)
(global $global$0 (mut i32) (i32.const 975663930))
(global $global$1 (mut i32) (i32.const 2066300474))
(global $global$2 (mut i64) (i64.const 20510))
(global $global$3 (mut f32) (f32.const -2147483648))
(global $global$4 (mut v128) (v128.const i32x4 0x7f002833 0x580000fe 0x59750500 0x01ff002f))
+ (global $global$5 (mut funcref) (ref.null))
+ (global $global$6 (mut anyref) (ref.null))
+ (global $global$7 (mut nullref) (ref.null))
+ (global $global$8 (mut nullref) (ref.null))
(global $hangLimit (mut i32) (i32.const 10))
- (event $event$0 (attr 0) (param f64 f32))
+ (event $event$0 (attr 0) (param f64 exnref))
+ (event $event$1 (attr 0) (param exnref f32 v128 i32 funcref))
(export "hashMemory" (func $hashMemory))
(export "memory" (memory $0))
+ (export "func_8" (func $func_8))
+ (export "func_9_invoker" (func $func_9_invoker))
+ (export "func_11_invoker" (func $func_11_invoker))
+ (export "func_13" (func $func_13))
+ (export "func_15_invoker" (func $func_15_invoker))
+ (export "func_17_invoker" (func $func_17_invoker))
+ (export "func_19_invoker" (func $func_19_invoker))
+ (export "func_23_invoker" (func $func_23_invoker))
+ (export "func_25_invoker" (func $func_25_invoker))
+ (export "func_27_invoker" (func $func_27_invoker))
+ (export "func_29_invoker" (func $func_29_invoker))
+ (export "func_31" (func $func_31))
+ (export "func_31_invoker" (func $func_31_invoker))
+ (export "func_34" (func $func_34))
+ (export "func_34_invoker" (func $func_34_invoker))
(export "hangLimitInitializer" (func $hangLimitInitializer))
- (func $hashMemory (; 5 ;) (result i32)
+ (func $hashMemory (; 7 ;) (result i32)
(local $0 i32)
(local.set $0
(i32.const 5381)
@@ -257,7 +294,158 @@
)
(local.get $0)
)
- (func $func_6 (; 6 ;) (result i32)
+ (func $func_8 (; 8 ;)
+ (local $0 v128)
+ (local $1 exnref)
+ (local $2 f64)
+ (local $3 f32)
+ (local $4 i64)
+ (local $5 funcref)
+ (local $6 v128)
+ (local $7 funcref)
+ (local $8 i64)
+ (local $9 funcref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (nop)
+ (local.set $9
+ (local.tee $7
+ (local.tee $7
+ (local.tee $9
+ (local.tee $5
+ (local.tee $7
+ (local.get $9)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ (func $func_9 (; 9 ;) (param $0 anyref) (param $1 i64) (param $2 i32) (param $3 f32) (param $4 nullref) (param $5 exnref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (call $log-exnref
+ (block $label$0
+ (call $log-f64
+ (f64.const 27)
+ )
+ (return)
+ )
+ )
+ )
+ (func $func_9_invoker (; 10 ;)
+ (call $func_9
+ (ref.null)
+ (i64.const -114)
+ (i32.const -1)
+ (f32.const -nan:0x7ffff0)
+ (ref.null)
+ (ref.null)
+ )
+ (call $func_9
+ (ref.null)
+ (i64.const -128)
+ (i32.const 2147483647)
+ (f32.const 2305843009213693952)
+ (ref.null)
+ (ref.null)
+ )
+ (call $func_9
+ (ref.null)
+ (i64.const -84)
+ (i32.const -77)
+ (f32.const 65463)
+ (ref.null)
+ (ref.null)
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_11 (; 11 ;) (param $0 f32) (param $1 v128) (param $2 v128) (param $3 f32) (result nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (ref.null)
+ )
+ (func $func_11_invoker (; 12 ;)
+ (drop
+ (call $func_11
+ (f32.const -4)
+ (v128.const i32x4 0xffffffe8 0x00000a12 0x00000002 0xffffff80)
+ (v128.const i32x4 0x00000000 0x00000001 0x00000000 0x40000000)
+ (f32.const 4503599627370496)
+ )
+ )
+ (drop
+ (call $func_11
+ (f32.const 2.7426516613360263e-09)
+ (v128.const i32x4 0x0d080315 0x00001811 0xfffffc00 0x0000007f)
+ (v128.const i32x4 0x0000187f 0x042c50ee 0x005c171b 0x001a1b1a)
+ (f32.const -nan:0x7ffff0)
+ )
+ )
+ )
+ (func $func_13 (; 13 ;) (result i64)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i64.const 114)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i64.const 9093677305969276536)
+ )
+ (func $func_14 (; 14 ;) (result i64)
(local $0 i64)
(block
(if
@@ -265,7 +453,7 @@
(global.get $hangLimit)
)
(return
- (i32.const 1296977737)
+ (local.get $0)
)
)
(global.set $hangLimit
@@ -277,20 +465,192 @@
)
(block $label$0
(nop)
+ (return
+ (i64.const 302456592)
+ )
+ )
+ )
+ (func $func_15 (; 15 ;) (param $0 v128) (param $1 anyref) (param $2 i32) (param $3 i32) (result funcref)
+ (local $4 funcref)
+ (local $5 f64)
+ (local $6 i32)
+ (local $7 i64)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (local.get $4)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (call $log-exnref
+ (ref.null)
+ )
+ (return
+ (local.get $4)
+ )
+ )
+ )
+ (func $func_15_invoker (; 16 ;)
+ (drop
+ (call $func_15
+ (v128.const i32x4 0x00080000 0x1a180e76 0x3a25515d 0xffff8001)
+ (ref.null)
+ (i32.const 202116108)
+ (i32.const 151587164)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_17 (; 17 ;) (result i32)
+ (local $0 i64)
+ (local $1 v128)
+ (local $2 v128)
+ (local $3 f32)
+ (local $4 funcref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const 332)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (loop $label$1
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const -128)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$2
+ (nop)
+ (nop)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (return
+ (i32.const 84215045)
+ )
+ )
+ )
+ (func $func_17_invoker (; 18 ;)
+ (drop
+ (call $func_17)
+ )
+ )
+ (func $func_19 (; 19 ;) (param $0 i64) (result i32)
+ (local $1 f32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const 2)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i32.const 65536)
+ )
+ (func $func_19_invoker (; 20 ;)
+ (drop
+ (call $func_19
+ (i64.const 129)
+ )
+ )
+ (drop
+ (call $func_19
+ (i64.const 562949953421312)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_19
+ (i64.const -32767)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_21 (; 21 ;) (result i32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const 90)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
(nop)
(return
- (i32.const -4096)
+ (i32.const 7446)
)
)
)
- (func $func_7 (; 7 ;) (param $0 f64) (param $1 i32) (result v128)
+ (func $func_22 (; 22 ;) (result f32)
+ (local $0 i64)
+ (local $1 exnref)
+ (local $2 funcref)
+ (local $3 i64)
+ (local $4 anyref)
(block
(if
(i32.eqz
(global.get $hangLimit)
)
(return
- (v128.const i32x4 0xd6000000 0xfffffff4 0x00000000 0xbf800000)
+ (f32.const 21554)
)
)
(global.set $hangLimit
@@ -300,730 +660,456 @@
)
)
)
- (block $label$0 (result v128)
- (call $log-v128
- (br_if $label$0
- (loop $label$1 (result v128)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0xe7010001 0xe5bb1b00 0x15001800 0x005d0001)
- )
+ (block $label$0
+ (return
+ (f32.const -1.1754943508222875e-38)
+ )
+ )
+ )
+ (func $func_23 (; 23 ;) (param $0 nullref) (result anyref)
+ (local $1 exnref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0 (result nullref)
+ (nop)
+ (loop $label$2 (result nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (loop $label$3 (result nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
)
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
+ (return
+ (ref.null)
)
)
- (block (result v128)
- (loop $label$2
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x00000000 0x405ac000 0x00000000 0x40448000)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block
- (block $label$3
- (call $log-i32
- (i32.const -43)
- )
- (call $log-i32
- (call $hashMemory)
- )
- )
- (br_if $label$2
- (if (result i32)
- (if (result i32)
- (block $label$4
- (call $log-i64
- (if (result i64)
- (i32.eqz
- (block $label$5 (result i32)
- (block $label$6
- (nop)
- (nop)
- )
- (local.get $1)
- )
- )
- (block $label$7 (result i64)
- (call $log-v128
- (call $func_7
- (f64.const 404429336)
- (local.tee $1
- (i32.const 128)
- )
- )
- )
- (i64.const -131072)
- )
- (block $label$8
- (call $log-i64
- (i64.const 4294967230)
- )
- (br $label$2)
- )
- )
- )
- (br $label$2)
- )
- (block $label$9 (result i32)
- (br_if $label$1
- (i32.eqz
- (local.tee $1
- (br_if $label$9
- (i32.const 1364020300)
- (i32.eqz
- (local.tee $1
- (br_if $label$9
- (loop $label$10 (result i32)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x0000084d 0x00000000 0x00000001 0x00000000)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (i32.const 151324422)
- )
- (i32.eqz
- (i32.const 65535)
- )
- )
- )
- )
- )
- )
- )
- )
- (select
- (local.get $1)
- (i32.const -124)
- (loop $label$11
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x5f5f5f5f 0xd2800000 0x59595959 0x469e9800)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block
- (block $label$12
- (loop $label$13
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x00000040 0x00000000 0x80000001 0x00000000)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$14
- (call $log-v128
- (v128.const i32x4 0xffea0000 0x0020ff80 0x50590000 0x1c002e39)
- )
- )
- )
- (call $log-f32
- (f32.const 35766419849216)
- )
- )
- (br_if $label$11
- (br_if $label$9
- (local.tee $1
- (i32.const -14)
- )
- (local.tee $1
- (local.tee $1
- (i32.const -67108864)
- )
- )
- )
- )
- (if
- (local.tee $1
- (local.tee $1
- (i32.const -32766)
- )
- )
- (block $label$15
- (nop)
- (br $label$11)
- )
- (block $label$16
- (loop $label$17
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x00000001 0xffffffff 0xffffffeb 0xffffffff)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block
- (block $label$18
- (call $log-i32
- (local.tee $1
- (local.get $1)
- )
- )
- (br_if $label$17
- (local.tee $1
- (loop $label$19 (result i32)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x05090b0a 0x06080f09 0x00007f63 0x80000000)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block (result i32)
- (call $log-i64
- (i64.const -28)
- )
- (br_if $label$19
- (local.tee $1
- (local.get $1)
- )
- )
- (i32.const -5)
- )
- )
- )
- )
- )
- (br_if $label$17
- (local.tee $1
- (local.get $1)
- )
- )
- (call $log-i32
- (call $hashMemory)
- )
- )
- )
- (br $label$1)
- )
- )
- )
- )
- )
- )
- (block $label$20
- (nop)
- (br $label$2)
- )
- )
- (block $label$21 (result i32)
- (call $log-i64
- (if (result i64)
- (if (result i32)
- (loop $label$22
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x641a061c 0x0000151a 0xffffff81 0x14071e1b)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$23
- (call $log-i32
- (block $label$24 (result i32)
- (nop)
- (loop $label$25 (result i32)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x40000000 0x4f000000 0x477fe400 0x4694b200)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block (result i32)
- (nop)
- (br_if $label$25
- (i32.const 31097)
- )
- (call $func_6)
- )
- )
- )
- )
- (br $label$2)
- )
- )
- (block $label$26
- (loop $label$27
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0xffffffa2 0x0e0f0e09 0x0000007f 0x116f110d)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block
- (block $label$28
- (call $log-i32
- (call $hashMemory)
- )
- (call $log-i64
- (i64.const -4194304)
- )
- )
- (br_if $label$27
- (i32.eqz
- (i32.const 2147483647)
- )
- )
- (nop)
- )
- )
- (br $label$2)
- )
- (block $label$29 (result i32)
- (call $log-f64
- (f64.const 8.697524797146243e-275)
- )
- (i32.const 262144)
- )
- )
- (block $label$30
- (call $log-i64
- (i64.const -24)
- )
- (br $label$2)
- )
- (i64.mul
- (i64.const 10797)
- (i64.const 4190383344442562905)
- )
- )
- )
- (br_if $label$21
- (local.tee $1
- (loop $label$35 (result i32)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x1d131913 0x00000000 0x00000000 0x00004000)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (if (result i32)
- (i32.eqz
- (local.get $1)
- )
- (block $label$36 (result i32)
- (call $log-i64
- (i64.const 3079)
- )
- (i32.const 24684)
- )
- (local.tee $1
- (i32.const 2048)
- )
- )
- )
- )
- (i32.eqz
- (br_if $label$21
- (block $label$32 (result i32)
- (call $log-f64
- (local.tee $0
- (local.tee $0
- (f64.const 1900100968416013050458753e112)
- )
- )
- )
- (i16x8.extract_lane_u 7
- (loop $label$33 (result v128)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x1c171e11 0xfffc0000 0x00004d42 0xfc000000)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (loop $label$34 (result v128)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x80000000 0x00008000 0x00000020 0x00800000)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (v128.const i32x4 0x00000000 0x43b00000 0x00000000 0xc0300000)
- )
- )
- )
- )
- (i32.eqz
- (block $label$31
- (call $log-i32
- (call $hashMemory)
- )
- (br $label$1)
- )
- )
- )
- )
- )
- )
- (block $label$37
- (if
- (block $label$38 (result i32)
- (call $log-f64
- (local.get $0)
- )
- (local.tee $1
- (i32.const -116)
- )
- )
- (call $log-i32
- (call $hashMemory)
- )
- (block $label$39
- (call $log-i32
- (i32.const -1)
- )
- (call $log-i32
- (call $hashMemory)
- )
- )
- )
- (br $label$2)
- )
- )
- )
- (call $log-i64
- (i64.const 65481)
- )
- )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
)
- (br_if $label$1
- (i32.eqz
- (block $label$40 (result i32)
- (drop
- (block
- (if
- (i32.eqz
- (block $label$46
- (call $log-i32
- (call $hashMemory)
- )
- (block $label$47
- (call $log-v128
- (v128.const i32x4 0xfc000000 0x00000041 0x5e48481b 0x36703625)
- )
- (br $label$1)
- )
- )
- )
- (block $label$48
- (call $log-i64
- (loop $label$49 (result i64)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x16590e16 0x17590d0e 0x00000000 0x41600000)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$50 (result i64)
- (i64.const -9223372036854775807)
- )
- )
- )
- (br $label$1)
- )
- (block $label$51
- (local.set $0
- (loop $label$52 (result f64)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x8e997f88 0x00b56f00 0xff010000 0x02004300)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block (result f64)
- (call $log-f64
- (f64.const 128)
- )
- (br_if $label$52
- (i32.eqz
- (block $label$53
- (call $log-f64
- (f64.const 4.955179737724083e-183)
- )
- (br $label$1)
- )
- )
- )
- (local.tee $0
- (loop $label$54 (result f64)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x00040000 0x00000050 0x00010000 0xfffffff0)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (f64.const 1.1754943508222875e-38)
- )
- )
- )
- )
- )
- (br $label$1)
- )
- )
- (br_if $label$40
- (block $label$45 (result i32)
- (call $log-f64
- (local.tee $0
- (f64.const 1073741824)
- )
- )
- (local.get $1)
- )
- (i32.eqz
- (br_if $label$40
- (local.tee $1
- (loop $label$44 (result i32)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0xff520000 0x55041a00 0x15807253 0x011be7a2)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (local.get $1)
- )
- )
- (if
- (i32.eqz
- (block $label$41
- (nop)
- (br $label$1)
- )
- )
- (block $label$42
- (call $log-f32
- (f32.const 1162102144)
- )
- (br $label$1)
- )
- (block $label$43
- (call $log-v128
- (v128.const i32x4 0x00001d1c 0x00000000 0x00000000 0x00000000)
- )
- (return
- (v128.const i32x4 0x7fffc000 0x0000125f 0xff01444e 0x1d1d0b01)
- )
- )
- )
- )
- )
- )
- )
- )
- (if (result i32)
- (br_if $label$40
- (br_if $label$40
- (local.tee $1
- (local.get $1)
- )
- (br_if $label$40
- (local.get $1)
- (br_if $label$40
- (local.tee $1
- (local.tee $1
- (local.get $1)
- )
- )
- (call $hashMemory)
- )
- )
- )
- (block $label$55 (result i32)
- (call $log-i32
- (call $hashMemory)
- )
- (local.get $1)
- )
- )
- (block $label$56 (result i32)
- (call $log-f32
- (f32.const 18773)
- )
- (i32.const 23632)
- )
- (local.get $1)
- )
- )
- )
+ )
+ )
+ (block (result nullref)
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (br_if $label$3
+ (i32.const 12)
+ )
+ (ref.null)
+ )
+ )
+ )
+ )
+ )
+ (func $func_23_invoker (; 24 ;)
+ (drop
+ (call $func_23
+ (ref.null)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_23
+ (ref.null)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_23
+ (ref.null)
+ )
+ )
+ )
+ (func $func_25 (; 25 ;) (param $0 f32) (result i64)
+ (local $1 i32)
+ (local $2 f64)
+ (local $3 funcref)
+ (local $4 i32)
+ (local $5 f32)
+ (local $6 anyref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i64.const -9223372036854775808)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i64.const -16)
+ )
+ (func $func_25_invoker (; 26 ;)
+ (drop
+ (call $func_25
+ (f32.const 30)
+ )
+ )
+ (drop
+ (call $func_25
+ (f32.const 17179869184)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_25
+ (f32.const 2147483648)
+ )
+ )
+ (drop
+ (call $func_25
+ (f32.const -nan:0x7fffc1)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_25
+ (f32.const 9223372036854775808)
+ )
+ )
+ (drop
+ (call $func_25
+ (f32.const 0)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_25
+ (f32.const 8760)
+ )
+ )
+ )
+ (func $func_27 (; 27 ;) (param $0 i32) (param $1 exnref) (param $2 exnref) (param $3 v128) (param $4 v128) (param $5 v128) (result nullref)
+ (local $6 f32)
+ (local $7 v128)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (call $log-i64
+ (i64.const 84)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ )
+ (func $func_27_invoker (; 28 ;)
+ (drop
+ (call $func_27
+ (i32.const -69)
+ (ref.null)
+ (ref.null)
+ (v128.const i32x4 0x00000000 0x40800800 0x00000000 0x42200000)
+ (v128.const i32x4 0x00800000 0x42dc0000 0x40000000 0xcf000000)
+ (v128.const i32x4 0x00000000 0x41e00000 0x00000000 0x38100000)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_29 (; 29 ;) (result i32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const 7)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i32.const -18)
+ )
+ (func $func_29_invoker (; 30 ;)
+ (drop
+ (call $func_29)
+ )
+ )
+ (func $func_31 (; 31 ;) (param $0 v128) (result nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (if
+ (i32.load8_s offset=22
+ (i32.and
+ (i32.const 774514976)
+ (i32.const 15)
+ )
+ )
+ (select
+ (block $label$0
+ (block $label$1
+ (block $label$5
+ (call $log-i32
+ (call $hashMemory)
)
- (v128.const i32x4 0xca000000 0x07101419 0x46b62a00 0xffffffe5)
+ (return
+ (ref.null)
+ )
+ )
+ )
+ )
+ (return_call $func_31
+ (local.tee $0
+ (v128.const i32x4 0x00000000 0xc3e00000 0x00000000 0x40b70500)
+ )
+ )
+ (i32.const 0)
+ )
+ (block $label$3
+ (nop)
+ (block $label$4
+ (call $log-f32
+ (f32.const -1152921504606846976)
+ )
+ (return_call $func_31
+ (v128.const i32x4 0x08000000 0x00000000 0xffff8000 0xffffffff)
+ )
+ )
+ )
+ )
+ )
+ (func $func_31_invoker (; 32 ;)
+ (drop
+ (call $func_31
+ (v128.const i32x4 0x00080000 0x00000081 0xffffffad 0x00000001)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_33 (; 33 ;)
+ (local $0 i32)
+ (local $1 f64)
+ (local $2 i64)
+ (local $3 f64)
+ (local $4 i64)
+ (local $5 anyref)
+ (local $6 i32)
+ (local $7 v128)
+ (local $8 i32)
+ (local $9 f64)
+ (local $10 f64)
+ (local $11 nullref)
+ (local $12 v128)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (local.set $11
+ (ref.null)
+ )
+ )
+ (func $func_34 (; 34 ;) (param $0 f64) (param $1 i32) (param $2 i64) (param $3 f64) (param $4 f32) (result anyref)
+ (local $5 funcref)
+ (local $6 f32)
+ (local $7 funcref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (ref.null)
+ )
+ (func $func_34_invoker (; 35 ;)
+ (drop
+ (call $func_34
+ (f64.const -2.2250738585072014e-308)
+ (i32.const 1679427100)
+ (i64.const 5402)
+ (f64.const -1.1754943508222875e-38)
+ (f32.const 16384)
+ )
+ )
+ (drop
+ (call $func_34
+ (f64.const 4294967296)
+ (i32.const 0)
+ (i64.const 19531)
+ (f64.const 1256914182047749521306957e208)
+ (f32.const 470816288)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_36 (; 36 ;) (result funcref)
+ (local $0 nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0 (result funcref)
+ (call $log-f32
+ (block $label$1
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (return
+ (ref.func $func_15_invoker)
+ )
+ )
+ )
+ (loop $label$2 (result funcref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.func $func_27_invoker)
)
)
- (i32.eqz
- (i32.const 16719)
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result funcref)
+ (block $label$3
+ (br_if $label$2
+ (i32.const 11)
+ )
+ (nop)
+ )
+ (br_if $label$2
+ (i32.eqz
+ (i32.const -119)
+ )
+ )
+ (block (result funcref)
+ (nop)
+ (br_if $label$2
+ (i32.eqz
+ (i32.const -119)
+ )
+ )
+ (ref.func $func_34_invoker)
)
)
)
- (v128.const i32x4 0x1d735757 0xd9800000 0xffffffc5 0xc9800000)
)
)
- (func $hangLimitInitializer (; 8 ;)
+ (func $hangLimitInitializer (; 37 ;)
(global.set $hangLimit
(i32.const 10)
)
diff --git a/test/passes/translate-to-fuzz_no-fuzz-nans_all-features.txt b/test/passes/translate-to-fuzz_no-fuzz-nans_all-features.txt
index 8c34a1384..7a1000fd5 100644
--- a/test/passes/translate-to-fuzz_no-fuzz-nans_all-features.txt
+++ b/test/passes/translate-to-fuzz_no-fuzz-nans_all-features.txt
@@ -1,34 +1,72 @@
(module
- (type $none_=>_i32 (func (result i32)))
(type $none_=>_none (func))
+ (type $none_=>_i32 (func (result i32)))
+ (type $none_=>_i64 (func (result i64)))
(type $i32_=>_none (func (param i32)))
(type $i64_=>_none (func (param i64)))
(type $f32_=>_none (func (param f32)))
(type $f64_=>_none (func (param f64)))
- (type $f64_f32_=>_none (func (param f64 f32)))
+ (type $f64_exnref_=>_none (func (param f64 exnref)))
(type $v128_=>_none (func (param v128)))
+ (type $anyref_i64_i32_f32_nullref_exnref_=>_none (func (param anyref i64 i32 f32 nullref exnref)))
+ (type $nullref_=>_none (func (param nullref)))
+ (type $exnref_=>_none (func (param exnref)))
+ (type $exnref_f32_v128_i32_funcref_=>_none (func (param exnref f32 v128 i32 funcref)))
+ (type $i64_=>_i32 (func (param i64) (result i32)))
+ (type $f32_=>_i64 (func (param f32) (result i64)))
+ (type $none_=>_f32 (func (result f32)))
(type $f32_=>_f32 (func (param f32) (result f32)))
(type $f64_=>_f64 (func (param f64) (result f64)))
- (type $f64_i32_=>_v128 (func (param f64 i32) (result v128)))
+ (type $none_=>_funcref (func (result funcref)))
+ (type $v128_anyref_i32_i32_=>_funcref (func (param v128 anyref i32 i32) (result funcref)))
+ (type $f64_i32_i64_f64_f32_=>_anyref (func (param f64 i32 i64 f64 f32) (result anyref)))
+ (type $nullref_=>_anyref (func (param nullref) (result anyref)))
+ (type $i32_exnref_exnref_v128_v128_v128_=>_nullref (func (param i32 exnref exnref v128 v128 v128) (result nullref)))
+ (type $f32_v128_v128_f32_=>_nullref (func (param f32 v128 v128 f32) (result nullref)))
+ (type $v128_=>_nullref (func (param v128) (result nullref)))
(import "fuzzing-support" "log-i32" (func $log-i32 (param i32)))
(import "fuzzing-support" "log-i64" (func $log-i64 (param i64)))
(import "fuzzing-support" "log-f32" (func $log-f32 (param f32)))
(import "fuzzing-support" "log-f64" (func $log-f64 (param f64)))
(import "fuzzing-support" "log-v128" (func $log-v128 (param v128)))
- (memory $0 (shared 1 1))
+ (import "fuzzing-support" "log-nullref" (func $log-nullref (param nullref)))
+ (import "fuzzing-support" "log-exnref" (func $log-exnref (param exnref)))
+ (memory $0 1 1)
(data (i32.const 0) "N\0fN\f5\f9\b1\ff\fa\eb\e5\fe\a7\ec\fb\fc\f4\a6\e4\ea\f0\ae\e3")
- (table $0 0 0 funcref)
+ (table $0 10 10 funcref)
+ (elem (i32.const 0) $func_8 $func_13 $func_13 $func_13 $func_14 $func_15 $func_17 $func_23 $func_23 $func_31)
(global $global$0 (mut i32) (i32.const 975663930))
(global $global$1 (mut i32) (i32.const 2066300474))
(global $global$2 (mut i64) (i64.const 20510))
(global $global$3 (mut f32) (f32.const -2147483648))
(global $global$4 (mut v128) (v128.const i32x4 0x7f002833 0x580000fe 0x59750500 0x01ff002f))
+ (global $global$5 (mut funcref) (ref.null))
+ (global $global$6 (mut anyref) (ref.null))
+ (global $global$7 (mut nullref) (ref.null))
+ (global $global$8 (mut nullref) (ref.null))
(global $hangLimit (mut i32) (i32.const 10))
- (event $event$0 (attr 0) (param f64 f32))
+ (event $event$0 (attr 0) (param f64 exnref))
+ (event $event$1 (attr 0) (param exnref f32 v128 i32 funcref))
(export "hashMemory" (func $hashMemory))
(export "memory" (memory $0))
+ (export "func_8" (func $func_8))
+ (export "func_9_invoker" (func $func_9_invoker))
+ (export "func_11_invoker" (func $func_11_invoker))
+ (export "func_13" (func $func_13))
+ (export "func_15_invoker" (func $func_15_invoker))
+ (export "func_17_invoker" (func $func_17_invoker))
+ (export "func_19_invoker" (func $func_19_invoker))
+ (export "func_23_invoker" (func $func_23_invoker))
+ (export "func_25_invoker" (func $func_25_invoker))
+ (export "func_27_invoker" (func $func_27_invoker))
+ (export "func_29_invoker" (func $func_29_invoker))
+ (export "func_31" (func $func_31))
+ (export "func_31_invoker" (func $func_31_invoker))
+ (export "func_34" (func $func_34))
+ (export "func_34_invoker" (func $func_34_invoker))
+ (export "func_36" (func $func_36))
(export "hangLimitInitializer" (func $hangLimitInitializer))
- (func $hashMemory (; 5 ;) (result i32)
+ (func $hashMemory (; 7 ;) (result i32)
(local $0 i32)
(local.set $0
(i32.const 5381)
@@ -259,15 +297,334 @@
)
(local.get $0)
)
- (func $func_6 (; 6 ;) (result i32)
+ (func $func_8 (; 8 ;)
+ (local $0 v128)
+ (local $1 exnref)
+ (local $2 f64)
+ (local $3 f32)
+ (local $4 i64)
+ (local $5 funcref)
+ (local $6 v128)
+ (local $7 funcref)
+ (local $8 i64)
+ (local $9 funcref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (nop)
+ (local.set $9
+ (local.tee $7
+ (local.tee $7
+ (local.tee $9
+ (local.tee $5
+ (local.tee $7
+ (local.get $9)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ (func $func_9 (; 9 ;) (param $0 anyref) (param $1 i64) (param $2 i32) (param $3 f32) (param $4 nullref) (param $5 exnref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (call $log-exnref
+ (block $label$0
+ (call $log-f64
+ (f64.const 27)
+ )
+ (return)
+ )
+ )
+ )
+ (func $func_9_invoker (; 10 ;)
+ (call $func_9
+ (ref.null)
+ (i64.const -114)
+ (i32.const -1)
+ (f32.const 0)
+ (ref.null)
+ (ref.null)
+ )
+ (call $func_9
+ (ref.null)
+ (i64.const -128)
+ (i32.const 2147483647)
+ (f32.const 2305843009213693952)
+ (ref.null)
+ (ref.null)
+ )
+ (call $func_9
+ (ref.null)
+ (i64.const -84)
+ (i32.const -77)
+ (f32.const 65463)
+ (ref.null)
+ (ref.null)
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_11 (; 11 ;) (param $0 f32) (param $1 v128) (param $2 v128) (param $3 f32) (result nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (ref.null)
+ )
+ (func $func_11_invoker (; 12 ;)
+ (drop
+ (call $func_11
+ (f32.const -4)
+ (v128.const i32x4 0xffffffe8 0x00000a12 0x00000002 0xffffff80)
+ (v128.const i32x4 0x00000000 0x00000001 0x00000000 0x40000000)
+ (f32.const 4503599627370496)
+ )
+ )
+ (drop
+ (call $func_11
+ (f32.const 2.7426516613360263e-09)
+ (v128.const i32x4 0x0d080315 0x00001811 0xfffffc00 0x0000007f)
+ (v128.const i32x4 0x0000187f 0x042c50ee 0x005c171b 0x001a1b1a)
+ (f32.const 0)
+ )
+ )
+ )
+ (func $func_13 (; 13 ;) (result i64)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i64.const 114)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i64.const 9093677305969276536)
+ )
+ (func $func_14 (; 14 ;) (result i64)
+ (local $0 i64)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (local.get $0)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (nop)
+ (return
+ (i64.const 302456592)
+ )
+ )
+ )
+ (func $func_15 (; 15 ;) (param $0 v128) (param $1 anyref) (param $2 i32) (param $3 i32) (result funcref)
+ (local $4 funcref)
+ (local $5 f64)
+ (local $6 i32)
+ (local $7 i64)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (local.get $4)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (call $log-exnref
+ (ref.null)
+ )
+ (return
+ (local.get $4)
+ )
+ )
+ )
+ (func $func_15_invoker (; 16 ;)
+ (drop
+ (call $func_15
+ (v128.const i32x4 0x00080000 0x1a180e76 0x3a25515d 0xffff8001)
+ (ref.null)
+ (i32.const 202116108)
+ (i32.const 151587164)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_17 (; 17 ;) (result i32)
(local $0 i64)
+ (local $1 v128)
+ (local $2 v128)
+ (local $3 f32)
+ (local $4 funcref)
(block
(if
(i32.eqz
(global.get $hangLimit)
)
(return
- (i32.const 1296977737)
+ (i32.const 332)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (loop $label$1
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const -128)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$2
+ (nop)
+ (nop)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (return
+ (i32.const 84215045)
+ )
+ )
+ )
+ (func $func_17_invoker (; 18 ;)
+ (drop
+ (call $func_17)
+ )
+ )
+ (func $func_19 (; 19 ;) (param $0 i64) (result i32)
+ (local $1 f32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const 2)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i32.const 65536)
+ )
+ (func $func_19_invoker (; 20 ;)
+ (drop
+ (call $func_19
+ (i64.const 129)
+ )
+ )
+ (drop
+ (call $func_19
+ (i64.const 562949953421312)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_19
+ (i64.const -32767)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_21 (; 21 ;) (result i32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const 90)
)
)
(global.set $hangLimit
@@ -279,21 +636,354 @@
)
(block $label$0
(nop)
+ (return
+ (i32.const 7446)
+ )
+ )
+ )
+ (func $func_22 (; 22 ;) (result f32)
+ (local $0 i64)
+ (local $1 exnref)
+ (local $2 funcref)
+ (local $3 i64)
+ (local $4 anyref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (f32.const 21554)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (return
+ (f32.const -1.1754943508222875e-38)
+ )
+ )
+ )
+ (func $func_23 (; 23 ;) (param $0 nullref) (result anyref)
+ (local $1 exnref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0 (result nullref)
(nop)
+ (loop $label$2 (result nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (loop $label$3 (result nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result nullref)
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (br_if $label$3
+ (i32.const 12)
+ )
+ (ref.null)
+ )
+ )
+ )
+ )
+ )
+ (func $func_23_invoker (; 24 ;)
+ (drop
+ (call $func_23
+ (ref.null)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_23
+ (ref.null)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_23
+ (ref.null)
+ )
+ )
+ )
+ (func $func_25 (; 25 ;) (param $0 f32) (result i64)
+ (local $1 i32)
+ (local $2 f64)
+ (local $3 funcref)
+ (local $4 i32)
+ (local $5 f32)
+ (local $6 anyref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i64.const -9223372036854775808)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i64.const -16)
+ )
+ (func $func_25_invoker (; 26 ;)
+ (drop
+ (call $func_25
+ (f32.const 30)
+ )
+ )
+ (drop
+ (call $func_25
+ (f32.const 17179869184)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_25
+ (f32.const 2147483648)
+ )
+ )
+ (drop
+ (call $func_25
+ (f32.const 0)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_25
+ (f32.const 9223372036854775808)
+ )
+ )
+ (drop
+ (call $func_25
+ (f32.const 0)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (drop
+ (call $func_25
+ (f32.const 8760)
+ )
+ )
+ )
+ (func $func_27 (; 27 ;) (param $0 i32) (param $1 exnref) (param $2 exnref) (param $3 v128) (param $4 v128) (param $5 v128) (result nullref)
+ (local $6 f32)
+ (local $7 v128)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (call $log-i64
+ (i64.const 84)
+ )
(return
- (i32.const -4096)
+ (ref.null)
+ )
+ )
+ )
+ (func $func_27_invoker (; 28 ;)
+ (drop
+ (call $func_27
+ (i32.const -69)
+ (ref.null)
+ (ref.null)
+ (v128.const i32x4 0x00000000 0x40800800 0x00000000 0x42200000)
+ (v128.const i32x4 0x00800000 0x42dc0000 0x40000000 0xcf000000)
+ (v128.const i32x4 0x00000000 0x41e00000 0x00000000 0x38100000)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_29 (; 29 ;) (result i32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (i32.const 7)
+ )
)
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i32.const -18)
+ )
+ (func $func_29_invoker (; 30 ;)
+ (drop
+ (call $func_29)
)
)
- (func $func_7 (; 7 ;) (param $0 f64) (param $1 i32) (result v128)
+ (func $func_31 (; 31 ;) (param $0 v128) (result nullref)
(block
(if
(i32.eqz
(global.get $hangLimit)
)
(return
- (v128.const i32x4 0x00008048 0x6400ed00 0x00010101 0x264ec77c)
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (if
+ (i32.load8_s offset=22
+ (i32.and
+ (i32.const 774514976)
+ (i32.const 15)
+ )
+ )
+ (select
+ (block $label$0
+ (block $label$1
+ (block $label$5
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ )
)
+ (return_call $func_31
+ (local.tee $0
+ (v128.const i32x4 0x00000000 0xc3e00000 0x00000000 0x40b70500)
+ )
+ )
+ (i32.const 0)
+ )
+ (block $label$3
+ (nop)
+ (block $label$4
+ (call $log-f32
+ (f32.const -1152921504606846976)
+ )
+ (return_call $func_31
+ (v128.const i32x4 0x08000000 0x00000000 0xffff8000 0xffffffff)
+ )
+ )
+ )
+ )
+ )
+ (func $func_31_invoker (; 32 ;)
+ (drop
+ (call $func_31
+ (v128.const i32x4 0x00080000 0x00000081 0xffffffad 0x00000001)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_33 (; 33 ;)
+ (local $0 i32)
+ (local $1 f64)
+ (local $2 i64)
+ (local $3 f64)
+ (local $4 i64)
+ (local $5 anyref)
+ (local $6 i32)
+ (local $7 v128)
+ (local $8 i32)
+ (local $9 f64)
+ (local $10 f64)
+ (local $11 nullref)
+ (local $12 v128)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
)
(global.set $hangLimit
(i32.sub
@@ -302,14 +992,122 @@
)
)
)
- (v128.const i32x4 0x00000001 0x00000000 0xffffffed 0xffffffff)
+ (local.set $11
+ (ref.null)
+ )
+ )
+ (func $func_34 (; 34 ;) (param $0 f64) (param $1 i32) (param $2 i64) (param $3 f64) (param $4 f32) (result anyref)
+ (local $5 funcref)
+ (local $6 f32)
+ (local $7 funcref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (ref.null)
+ )
+ (func $func_34_invoker (; 35 ;)
+ (drop
+ (call $func_34
+ (f64.const -2.2250738585072014e-308)
+ (i32.const 1679427100)
+ (i64.const 5402)
+ (f64.const -1.1754943508222875e-38)
+ (f32.const 16384)
+ )
+ )
+ (drop
+ (call $func_34
+ (f64.const 4294967296)
+ (i32.const 0)
+ (i64.const 19531)
+ (f64.const 1256914182047749521306957e208)
+ (f32.const 470816288)
+ )
+ )
+ (call $log-i32
+ (call $hashMemory)
+ )
+ )
+ (func $func_36 (; 36 ;) (result funcref)
+ (local $0 nullref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.null)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0 (result funcref)
+ (call $log-f32
+ (block $label$1
+ (call $log-i32
+ (i32.const 117705997)
+ )
+ (return
+ (ref.func $func_15_invoker)
+ )
+ )
+ )
+ (loop $label$2 (result funcref)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return
+ (ref.func $func_17)
+ )
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result funcref)
+ (block $label$3
+ (br_if $label$3
+ (i32.const 909193002)
+ )
+ (nop)
+ )
+ (br_if $label$2
+ (i32.const -2147483648)
+ )
+ (ref.func $func_17)
+ )
+ )
+ )
)
- (func $hangLimitInitializer (; 8 ;)
+ (func $hangLimitInitializer (; 37 ;)
(global.set $hangLimit
(i32.const 10)
)
)
- (func $deNan32 (; 9 ;) (param $0 f32) (result f32)
+ (func $deNan32 (; 38 ;) (param $0 f32) (result f32)
(if (result f32)
(f32.eq
(local.get $0)
@@ -319,7 +1117,7 @@
(f32.const 0)
)
)
- (func $deNan64 (; 10 ;) (param $0 f64) (result f64)
+ (func $deNan64 (; 39 ;) (param $0 f64) (result f64)
(if (result f64)
(f64.eq
(local.get $0)