summaryrefslogtreecommitdiff
path: root/test/passes
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-05-31 20:02:37 -0700
committerGitHub <noreply@github.com>2019-05-31 20:02:37 -0700
commitfe99e3458f11d1a01fa3ad5b68883dbcba3903af (patch)
tree6f5eda61c7c7cba9c3b16be5e361cdc148d8b315 /test/passes
parent7306f60a4474ca1fa948bddee5c068e7c2f635f6 (diff)
downloadbinaryen-fe99e3458f11d1a01fa3ad5b68883dbcba3903af.tar.gz
binaryen-fe99e3458f11d1a01fa3ad5b68883dbcba3903af.tar.bz2
binaryen-fe99e3458f11d1a01fa3ad5b68883dbcba3903af.zip
Add event section (#2151)
This adds support for the event and the event section, as specified in https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md#changes-to-the-binary-model. Wasm events are features that suspend the current execution and transfer the control flow to a corresponding handler. Currently the only supported event kind is exceptions. For events, this includes support for - Binary file reading/writing - Wast file reading/writing - Binaryen.js API - Fuzzer - Validation - Metadce - Passes: metrics, minify-imports-and-exports, remove-unused-module-elements
Diffstat (limited to 'test/passes')
-rw-r--r--test/passes/O3_low-memory-unused_metrics.txt1
-rw-r--r--test/passes/converge_O3_metrics.bin.txt3
-rw-r--r--test/passes/func-metrics.txt6
-rw-r--r--test/passes/metrics_all-features.txt (renamed from test/passes/metrics.txt)5
-rw-r--r--test/passes/metrics_all-features.wast (renamed from test/passes/metrics.wast)2
-rw-r--r--test/passes/metrics_strip-debug_metrics.bin.txt2
-rw-r--r--test/passes/metrics_strip-producers_metrics.bin.txt2
-rw-r--r--test/passes/minify-imports-and-exports_all-features.txt (renamed from test/passes/minify-imports-and-exports.txt)15
-rw-r--r--test/passes/minify-imports-and-exports_all-features.wast (renamed from test/passes/minify-imports-and-exports.wast)4
-rw-r--r--test/passes/minify-imports_all-features.txt (renamed from test/passes/minify-imports.txt)6
-rw-r--r--test/passes/minify-imports_all-features.wast (renamed from test/passes/minify-imports.wast)4
-rw-r--r--test/passes/remove-unused-module-elements_all-features.txt (renamed from test/passes/remove-unused-module-elements_enable-threads.txt)5
-rw-r--r--test/passes/remove-unused-module-elements_all-features.wast (renamed from test/passes/remove-unused-module-elements_enable-threads.wast)9
-rw-r--r--test/passes/remove-unused-nonfunction-module-elements_all-features.txt (renamed from test/passes/remove-unused-nonfunction-module-elements_enable-threads.txt)9
-rw-r--r--test/passes/remove-unused-nonfunction-module-elements_all-features.wast (renamed from test/passes/remove-unused-nonfunction-module-elements_enable-threads.wast)9
-rw-r--r--test/passes/translate-to-fuzz_all-features.txt770
-rw-r--r--test/passes/translate-to-fuzz_all-features.wast2
-rw-r--r--test/passes/translate-to-fuzz_no-fuzz-nans_all-features.txt783
-rw-r--r--test/passes/translate-to-fuzz_no-fuzz-nans_all-features.wast2
19 files changed, 953 insertions, 686 deletions
diff --git a/test/passes/O3_low-memory-unused_metrics.txt b/test/passes/O3_low-memory-unused_metrics.txt
index 91ddf6d87..bf5cd01a8 100644
--- a/test/passes/O3_low-memory-unused_metrics.txt
+++ b/test/passes/O3_low-memory-unused_metrics.txt
@@ -1,4 +1,5 @@
total
+ [events] : 0
[exports] : 1
[funcs] : 1
[globals] : 0
diff --git a/test/passes/converge_O3_metrics.bin.txt b/test/passes/converge_O3_metrics.bin.txt
index dd8470d0d..1c7a3275e 100644
--- a/test/passes/converge_O3_metrics.bin.txt
+++ b/test/passes/converge_O3_metrics.bin.txt
@@ -1,4 +1,5 @@
total
+ [events] : 0
[exports] : 2
[funcs] : 8
[globals] : 1
@@ -242,6 +243,7 @@ total
)
)
total
+ [events] : 0
[exports] : 2
[funcs] : 8
[globals] : 1
@@ -486,6 +488,7 @@ total
)
)
total
+ [events] : 0
[exports] : 2
[funcs] : 8
[globals] : 1
diff --git a/test/passes/func-metrics.txt b/test/passes/func-metrics.txt
index 83aabc2fe..a6e9b0c92 100644
--- a/test/passes/func-metrics.txt
+++ b/test/passes/func-metrics.txt
@@ -1,4 +1,5 @@
global
+ [events] : 0
[exports] : 0
[funcs] : 3
[globals] : 1
@@ -89,6 +90,7 @@ func: ifs
)
)
global
+ [events] : 0
[exports] : 0
[funcs] : 0
[globals] : 0
@@ -97,6 +99,7 @@ global
(module
)
global
+ [events] : 0
[exports] : 2
[funcs] : 3
[globals] : 0
@@ -171,6 +174,7 @@ export: b (func_b)
)
)
global
+ [events] : 0
[exports] : 1
[funcs] : 1
[globals] : 0
@@ -202,6 +206,7 @@ start: func_a
)
)
global
+ [events] : 0
[exports] : 0
[funcs] : 1
[globals] : 0
@@ -229,6 +234,7 @@ start: func_a
)
)
global
+ [events] : 0
[exports] : 1
[funcs] : 1
[globals] : 1
diff --git a/test/passes/metrics.txt b/test/passes/metrics_all-features.txt
index 95ca2c601..ba772597d 100644
--- a/test/passes/metrics.txt
+++ b/test/passes/metrics_all-features.txt
@@ -1,4 +1,5 @@
total
+ [events] : 2
[exports] : 0
[funcs] : 1
[globals] : 1
@@ -14,11 +15,14 @@ total
if : 4
(module
(type $0 (func (param i32)))
+ (type $FUNCSIG$vii (func (param i32 i32)))
(memory $0 256 256)
(data (i32.const 0) "\ff\ef\0f\1f 0@P\99")
(table $0 256 256 funcref)
(elem (i32.const 0) $ifs $ifs $ifs)
(global $glob i32 (i32.const 1337))
+ (event $e0 (attr 0) (param i32))
+ (event $e1 (attr 0) (param i32 i32))
(func $ifs (; 0 ;) (type $0) (param $x i32)
(local $y f32)
(block $block0
@@ -60,6 +64,7 @@ total
)
)
total
+ [events] : 0
[exports] : 0
[funcs] : 0
[globals] : 0
diff --git a/test/passes/metrics.wast b/test/passes/metrics_all-features.wast
index 5ae98b7c7..018262f22 100644
--- a/test/passes/metrics.wast
+++ b/test/passes/metrics_all-features.wast
@@ -5,6 +5,8 @@
(data (i32.const 0) "\ff\ef\0f\1f\20\30\40\50\99")
(type $0 (func (param i32)))
(global $glob i32 (i32.const 1337))
+ (event $e0 (attr 0) (param i32))
+ (event $e1 (attr 0) (param i32 i32))
(func $ifs (type $0) (param $x i32)
(local $y f32)
(block $block0
diff --git a/test/passes/metrics_strip-debug_metrics.bin.txt b/test/passes/metrics_strip-debug_metrics.bin.txt
index 3e7294453..51dfd1e79 100644
--- a/test/passes/metrics_strip-debug_metrics.bin.txt
+++ b/test/passes/metrics_strip-debug_metrics.bin.txt
@@ -1,4 +1,5 @@
total
+ [events] : 0
[exports] : 1
[funcs] : 1
[globals] : 0
@@ -7,6 +8,7 @@ total
[vars] : 0
nop : 1
total
+ [events] : 0
[exports] : 1
[funcs] : 1
[globals] : 0
diff --git a/test/passes/metrics_strip-producers_metrics.bin.txt b/test/passes/metrics_strip-producers_metrics.bin.txt
index e977d4ed5..290ed2599 100644
--- a/test/passes/metrics_strip-producers_metrics.bin.txt
+++ b/test/passes/metrics_strip-producers_metrics.bin.txt
@@ -1,4 +1,5 @@
total
+ [events] : 0
[exports] : 1
[funcs] : 1
[globals] : 0
@@ -7,6 +8,7 @@ total
[vars] : 0
nop : 1
total
+ [events] : 0
[exports] : 1
[funcs] : 1
[globals] : 0
diff --git a/test/passes/minify-imports-and-exports.txt b/test/passes/minify-imports-and-exports_all-features.txt
index b6a2cf8bf..78852dfa8 100644
--- a/test/passes/minify-imports-and-exports.txt
+++ b/test/passes/minify-imports-and-exports_all-features.txt
@@ -942,7 +942,7 @@ longname3488 => J9
longname1490 => JA
longname4946 => JAa
longname1544 => JB
-exp1 => JBa
+eventname1 => JBa
longname1598 => JC
longname1652 => JD
longname1706 => JE
@@ -1035,7 +1035,7 @@ longname3489 => K9
longname1491 => KA
longname4947 => KAa
longname1545 => KB
-exp2 => KBa
+exp1 => KBa
longname1599 => KC
longname1653 => KD
longname1707 => KE
@@ -1128,6 +1128,7 @@ longname3490 => L9
longname1492 => LA
longname4948 => LAa
longname1546 => LB
+exp2 => LBa
longname1600 => LC
longname1654 => LD
longname1708 => LE
@@ -1220,6 +1221,7 @@ longname3491 => M9
longname1493 => MA
longname4949 => MAa
longname1547 => MB
+event1 => MBa
longname1601 => MC
longname1655 => MD
longname1709 => ME
@@ -5002,6 +5004,8 @@ longname1426 => zz
longname4882 => zza
(module
(type $FUNCSIG$v (func))
+ (type $FUNCSIG$vi (func (param i32)))
+ (type $FUNCSIG$vii (func (param i32 i32)))
(import "env" "a" (global $import$global0 i32))
(import "env" "__memory_base" (global $import$global1 i32))
(import "env" "__table_base" (global $import$global2 i32))
@@ -10005,8 +10009,11 @@ longname4882 => zza
(import "env" "HBa" (func $internal4998))
(import "env" "IBa" (func $internal4999))
(import "other" "anything" (func $internalInfinity))
- (export "JBa" (func $foo1))
- (export "KBa" (func $foo2))
+ (import "env" "JBa" (event $eventname1 (attr 0) (param i32)))
+ (event $event1 (attr 0) (param i32 i32))
+ (export "KBa" (func $foo1))
+ (export "LBa" (func $foo2))
+ (export "MBa" (event $event1))
(func $foo1 (; 5000 ;) (type $FUNCSIG$v)
(nop)
)
diff --git a/test/passes/minify-imports-and-exports.wast b/test/passes/minify-imports-and-exports_all-features.wast
index ce0c46f95..2db91c2ad 100644
--- a/test/passes/minify-imports-and-exports.wast
+++ b/test/passes/minify-imports-and-exports_all-features.wast
@@ -5002,9 +5002,11 @@
(import "env" "__memory_base" (global i32))
(import "env" "__table_base" (global i32))
(import "other" "anything" (func $internalInfinity))
+ (import "env" "eventname1" (event $eventname1 (attr 0) (param i32)))
(export "exp1" (func $foo1))
(export "exp2" (func $foo2))
(func $foo1)
(func $foo2)
+ (export "event1" (event $event1))
+ (event $event1 (attr 0) (param i32 i32))
)
-
diff --git a/test/passes/minify-imports.txt b/test/passes/minify-imports_all-features.txt
index 45e295c67..024018bc2 100644
--- a/test/passes/minify-imports.txt
+++ b/test/passes/minify-imports_all-features.txt
@@ -942,6 +942,7 @@ longname3488 => J9
longname1490 => JA
longname4946 => JAa
longname1544 => JB
+eventname1 => JBa
longname1598 => JC
longname1652 => JD
longname1706 => JE
@@ -5000,6 +5001,8 @@ longname1426 => zz
longname4882 => zza
(module
(type $FUNCSIG$v (func))
+ (type $FUNCSIG$vi (func (param i32)))
+ (type $FUNCSIG$vii (func (param i32 i32)))
(import "env" "a" (global $import$global0 i32))
(import "env" "__memory_base" (global $import$global1 i32))
(import "env" "__table_base" (global $import$global2 i32))
@@ -10003,8 +10006,11 @@ longname4882 => zza
(import "env" "HBa" (func $internal4998))
(import "env" "IBa" (func $internal4999))
(import "other" "anything" (func $internalInfinity))
+ (import "env" "JBa" (event $eventname1 (attr 0) (param i32)))
+ (event $event1 (attr 0) (param i32 i32))
(export "foo1" (func $foo1))
(export "foo2" (func $foo2))
+ (export "event1" (event $event1))
(func $foo1 (; 5000 ;) (type $FUNCSIG$v)
(nop)
)
diff --git a/test/passes/minify-imports.wast b/test/passes/minify-imports_all-features.wast
index b24173163..26c8062ba 100644
--- a/test/passes/minify-imports.wast
+++ b/test/passes/minify-imports_all-features.wast
@@ -5002,9 +5002,11 @@
(import "env" "__memory_base" (global i32))
(import "env" "__table_base" (global i32))
(import "other" "anything" (func $internalInfinity))
+ (import "env" "eventname1" (event $eventname1 (attr 0) (param i32)))
(export "foo1" (func $foo1))
(export "foo2" (func $foo2))
+ (export "event1" (event $event1))
(func $foo1)
(func $foo2)
+ (event $event1 (attr 0) (param i32 i32))
)
-
diff --git a/test/passes/remove-unused-module-elements_enable-threads.txt b/test/passes/remove-unused-module-elements_all-features.txt
index 5db1ba5e6..3d80f96e9 100644
--- a/test/passes/remove-unused-module-elements_enable-threads.txt
+++ b/test/passes/remove-unused-module-elements_all-features.txt
@@ -278,3 +278,8 @@
)
)
)
+(module
+ (type $FUNCSIG$vj (func (param i64)))
+ (event $e1 (attr 0) (param i64))
+ (export "e1" (event $e1))
+)
diff --git a/test/passes/remove-unused-module-elements_enable-threads.wast b/test/passes/remove-unused-module-elements_all-features.wast
index 8e07fb9c1..3d0248848 100644
--- a/test/passes/remove-unused-module-elements_enable-threads.wast
+++ b/test/passes/remove-unused-module-elements_all-features.wast
@@ -261,4 +261,11 @@
)
)
)
-
+(module ;; non-exported events can be removed
+ (type $0 (func (param i32)))
+ (event $e0 (attr 0) (type $0))
+ (event $e1 (attr 0) (param i64))
+ (export "e1" (event $e1))
+ (import "env" "e" (event $e2 (attr 0) (param i32)))
+ (func $f (; 0 ;) (type $0))
+)
diff --git a/test/passes/remove-unused-nonfunction-module-elements_enable-threads.txt b/test/passes/remove-unused-nonfunction-module-elements_all-features.txt
index 140cf61e6..e08bf1eb2 100644
--- a/test/passes/remove-unused-nonfunction-module-elements_enable-threads.txt
+++ b/test/passes/remove-unused-nonfunction-module-elements_all-features.txt
@@ -329,3 +329,12 @@
)
)
)
+(module
+ (type $0 (func (param i32)))
+ (type $FUNCSIG$vj (func (param i64)))
+ (event $e1 (attr 0) (param i64))
+ (export "e1" (event $e1))
+ (func $f (; 0 ;) (type $0) (param $0 i32)
+ (nop)
+ )
+)
diff --git a/test/passes/remove-unused-nonfunction-module-elements_enable-threads.wast b/test/passes/remove-unused-nonfunction-module-elements_all-features.wast
index 4c1944c12..36bc79e82 100644
--- a/test/passes/remove-unused-nonfunction-module-elements_enable-threads.wast
+++ b/test/passes/remove-unused-nonfunction-module-elements_all-features.wast
@@ -261,4 +261,11 @@
)
)
)
-
+(module ;; non-exported events can be removed
+ (type $0 (func (param i32)))
+ (event $e0 (attr 0) (type $0))
+ (event $e1 (attr 0) (param i64))
+ (export "e1" (event $e1))
+ (import "env" "e" (event $e2 (attr 0) (param i32)))
+ (func $f (; 0 ;) (type $0))
+)
diff --git a/test/passes/translate-to-fuzz_all-features.txt b/test/passes/translate-to-fuzz_all-features.txt
index fe24e738e..c3fd77b20 100644
--- a/test/passes/translate-to-fuzz_all-features.txt
+++ b/test/passes/translate-to-fuzz_all-features.txt
@@ -1,33 +1,26 @@
(module
(type $FUNCSIG$i (func (result i32)))
+ (type $FUNCSIG$vifidi (func (param i32 f32 i32 f64 i32)))
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$vj (func (param i64)))
(type $FUNCSIG$vf (func (param f32)))
(type $FUNCSIG$vd (func (param f64)))
- (type $FUNCSIG$vjVdddV (func (param i64 v128 f64 f64 f64 v128)))
- (type $FUNCSIG$ddVff (func (param f64 v128 f32 f32) (result f64)))
- (type $FUNCSIG$VdVjf (func (param f64 v128 i64 f32) (result v128)))
- (type $FUNCSIG$v (func))
- (type $FUNCSIG$jjiV (func (param i64 i32 v128) (result i64)))
(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)))
- (memory $0 1 1)
+ (memory $0 (shared 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 8 funcref)
- (elem (i32.const 0) $func_6 $func_6 $func_6 $func_6 $func_9 $func_9 $func_9 $func_9)
- (global $global$0 (mut i32) (i32.const 975664160))
- (global $global$1 (mut i32) (i32.const -536870912))
- (global $global$2 (mut f32) (f32.const 2147483648))
- (global $global$3 (mut f32) (f32.const 1448959360))
+ (table $0 3 3 funcref)
+ (elem (i32.const 0) $func_5 $func_5 $func_5)
+ (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 $hangLimit (mut i32) (i32.const 10))
+ (event $event$0 (attr 0) (param i32 f32 i32 f64 i32))
(export "hashMemory" (func $hashMemory))
(export "func_5" (func $func_5))
- (export "func_6" (func $func_6))
- (export "func_7" (func $func_7))
- (export "func_7_invoker" (func $func_7_invoker))
- (export "func_9" (func $func_9))
(export "hangLimitInitializer" (func $hangLimitInitializer))
(func $hashMemory (; 4 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
@@ -260,171 +253,18 @@
)
(local.get $0)
)
- (func $func_5 (; 5 ;) (type $FUNCSIG$vjVdddV) (param $0 i64) (param $1 v128) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 v128)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return)
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$0
- (call $log-f64
- (loop $label$1 (result f64)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return)
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$2 (result f64)
- (call $log-i32
- (call $hashMemory)
- )
- (local.get $2)
- )
- )
- )
- (call $log-i32
- (call $hashMemory)
- )
- )
- )
- (func $func_6 (; 6 ;) (type $FUNCSIG$ddVff) (param $0 f64) (param $1 v128) (param $2 f32) (param $3 f32) (result f64)
- (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 (result f64)
- (call $log-i32
- (i32.const 84215045)
- )
- (f64.const 8)
- )
- )
- (func $func_7 (; 7 ;) (type $FUNCSIG$VdVjf) (param $0 f64) (param $1 v128) (param $2 i64) (param $3 f32) (result v128)
- (local $4 i32)
- (local $5 f64)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (local.get $1)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (local.tee $1
- (local.tee $1
- (v128.const i32x4 0x6d484708 0x13e740fc 0x5849037f 0xe4000000)
- )
- )
- )
- (func $func_7_invoker (; 8 ;) (type $FUNCSIG$v)
- (drop
- (call $func_7
- (f64.const 16986)
- (v128.const i32x4 0x00000000 0x00000010 0xffffe000 0xffffffff)
- (i64.const -12)
- (f32.const 7243)
- )
- )
- (drop
- (call $func_7
- (f64.const -65536)
- (v128.const i32x4 0x00007d1f 0x00000200 0xffff0000 0x7fffffff)
- (i64.const 288230376151711744)
- (f32.const 128)
- )
- )
- (call $log-i32
- (call $hashMemory)
- )
- (drop
- (call $func_7
- (f64.const -nan:0xfffffffffffb5)
- (v128.const i32x4 0x00000000 0x403a0000 0x00000000 0xb8100000)
- (i64.const 66)
- (f32.const -nan:0x7fffb0)
- )
- )
- )
- (func $func_9 (; 9 ;) (type $FUNCSIG$jjiV) (param $0 i64) (param $1 i32) (param $2 v128) (result i64)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (local.get $0)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (i64.const 8)
- )
- (func $func_10 (; 10 ;) (param $0 v128) (param $1 i64) (param $2 i64) (result v128)
+ (func $func_5 (; 5 ;) (type $FUNCSIG$vj) (param $0 i64)
+ (local $1 f64)
+ (local $2 i32)
(local $3 i64)
(local $4 v128)
- (local $5 f64)
- (local $6 f32)
- (local $7 v128)
- (local $8 f64)
- (local $9 i64)
- (local $10 f32)
- (local $11 i32)
- (local $12 f32)
- (local $13 i32)
- (local $14 v128)
- (local $15 v128)
- (local $16 f64)
+ (local $5 f32)
(block
(if
(i32.eqz
(global.get $hangLimit)
)
- (return
- (v128.const i32x4 0x80000000 0x80000001 0xffffffa1 0x00000000)
- )
+ (return)
)
(global.set $hangLimit
(i32.sub
@@ -434,300 +274,193 @@
)
)
(block $label$0
- (local.set $8
- (f64.const 5382)
+ (br_if $label$0
+ (i32.const 1376786182)
)
- (if
- (i32.eqz
- (local.tee $11
- (loop $label$72 (result i32)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (local.get $15)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (i32.const -127)
- )
- )
- )
- (block $label$19
- (block $label$20
- (loop $label$21
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x4598b000 0x4f000000 0x5f000000 0x4d30d0b0)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (nop)
- )
- (local.set $11
- (local.tee $13
- (i32.const 3088)
- )
- )
- )
- (return
- (local.get $0)
- )
- )
- (block $label$43
- (loop $label$44
- (block
- (if
+ (local.set $4
+ (v128.const i32x4 0x0e0a0e0d 0x0709060c 0x764b6f6f 0x00040000)
+ )
+ (local.set $4
+ (if (result v128)
+ (i32.eqz
+ (if (result i32)
+ (if (result i32)
(i32.eqz
- (global.get $hangLimit)
- )
- (return
- (local.get $4)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block
- (block $label$45
- (if
- (i32.eqz
- (i32.const 536870912)
- )
- (local.set $11
- (local.get $13)
- )
- (block $label$46
- (global.set $global$3
- (f32.const 269239296)
- )
- (local.tee $16
- (local.tee $16
- (block $label$47
- (br $label$46)
+ (if (result i32)
+ (i32.eqz
+ (if
+ (i32.const 1329942351)
+ (local.tee $2
+ (local.tee $2
+ (loop $label$38
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (if
+ (i32.eqz
+ (local.get $2)
+ )
+ (block $label$39
+ (nop)
+ (br $label$0)
+ )
+ (block $label$40
+ (local.set $4
+ (v128.const i32x4 0x05050505 0x46190000 0xc6800000 0x4a031a19)
+ )
+ (br $label$0)
+ )
+ )
+ )
+ )
+ )
+ (block $label$41
+ (nop)
+ (br $label$0)
)
)
)
+ (local.get $2)
+ (local.get $2)
+ )
+ )
+ (block $label$47
+ (local.set $2
+ (local.get $2)
)
+ (br $label$0)
)
- (loop $label$48
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
+ (block $label$48 (result i32)
+ (loop $label$49
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
)
- (return
- (local.get $4)
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
)
)
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
+ (block
+ (local.set $5
+ (f32.const 9.625223197211503e-38)
)
- )
- )
- (block
- (local.set $11
- (local.tee $13
- (i32.const 2097152)
- )
- )
- (br_if $label$48
- (i32.eqz
- (local.tee $11
- (loop $label$49 (result i32)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (local.get $0)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
+ (br_if $label$49
+ (if (result i32)
+ (block $label$57
+ (local.set $5
+ (local.tee $5
+ (block $label$58 (result f32)
+ (local.set $4
+ (local.get $4)
+ )
+ (local.get $5)
)
)
)
- (block (result i32)
- (local.set $10
- (local.tee $12
- (local.tee $6
- (local.tee $12
- (local.get $12)
- )
+ (br $label$0)
+ )
+ (if (result i32)
+ (i32.const 1376786182)
+ (block $label$60
+ (if
+ (block $label$61 (result i32)
+ (i32.const 925442358)
+ )
+ (block $label$62
+ (br_if $label$62
+ (i32.const 256)
)
)
- )
- (br_if $label$49
- (i32.const 512)
- )
- (loop $label$50 (result i32)
- (block
+ (block $label$63
(if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x0000002a 0xf801141f 0xfe1c005c 0xf1f27f14)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
+ (local.get $2)
+ (local.set $1
+ (local.get $1)
)
- )
- )
- (block $label$51 (result i32)
- (local.set $11
- (if (result i32)
- (i32.eqz
- (if (result i32)
- (if (result i32)
- (if (result i32)
- (i32.eqz
- (i32.const 170)
- )
- (i32.const 170)
- (i32.const 16)
- )
- (local.tee $11
- (local.get $13)
- )
- (block $label$52
- (local.set $13
- (local.get $11)
- )
- (br $label$44)
- )
- )
- (block $label$53
- (loop $label$54
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (local.get $14)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block
- (nop)
- (br_if $label$54
- (i32.eqz
- (local.get $13)
- )
- )
- (local.set $2
- (i64.const 112)
- )
- )
- )
- (br $label$49)
+ (block $label$67
+ (if
+ (i32.eqz
+ (i32.const 0)
+ )
+ (block $label$68
+ (local.set $1
+ (local.get $1)
)
- (local.tee $11
- (local.tee $13
- (local.get $11)
+ (block $label$69
+ (nop)
+ (local.set $4
+ (local.get $4)
)
)
)
- )
- (block $label$55 (result i32)
- (br_if $label$48
- (local.tee $11
- (local.tee $13
- (local.get $13)
+ (if
+ (i32.eqz
+ (br_if $label$48
+ (i32.const 32768)
+ (local.get $2)
)
)
- )
- (br_if $label$51
- (local.tee $11
- (local.tee $13
- (i32.const -62)
- )
+ (local.set $4
+ (v128.const i32x4 0xffffff81 0xffffffeb 0x80000000 0x74273131)
)
- (if (result i32)
- (i32.const 86)
- (block $label$56 (result i32)
- (br_if $label$56
- (local.get $13)
- (i32.const -84)
- )
- )
- (loop $label$57 (result i32)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (local.get $14)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (i32.const 34176355)
- )
+ (local.set $2
+ (local.get $2)
)
)
)
- (block $label$58
- (local.set $14
- (v128.const i32x4 0x0f0c0d04 0x0a020d43 0x1402026d 0x47130847)
- )
- (br $label$49)
+ (local.set $0
+ (i64.const -2097152)
)
)
)
- (loop $label$59
+ (local.set $1
+ (local.get $1)
+ )
+ )
+ )
+ (br $label$0)
+ )
+ (block $label$70 (result i32)
+ (loop $label$71 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result i32)
+ (loop $label$72
(block
(if
(i32.eqz
(global.get $hangLimit)
)
- (return
- (v128.const i32x4 0x00000000 0x43e00000 0x00000000 0xc1f00000)
- )
+ (return)
)
(global.set $hangLimit
(i32.sub
@@ -736,16 +469,21 @@
)
)
)
- (block $label$60
- (loop $label$61
+ (local.set $4
+ (local.tee $4
+ (local.get $4)
+ )
+ )
+ )
+ (br_if $label$71
+ (i32.eqz
+ (loop $label$73
(block
(if
(i32.eqz
(global.get $hangLimit)
)
- (return
- (v128.const i32x4 0x00007272 0x00000000 0x00000001 0x80000000)
- )
+ (return)
)
(global.set $hangLimit
(i32.sub
@@ -754,97 +492,127 @@
)
)
)
- (block $label$62
- (local.set $3
- (i64.const -2048)
- )
- (i64.store16 offset=3 align=1
- (i32.and
- (local.tee $13
- (local.tee $13
- (local.tee $13
- (i32.const 64)
- )
- )
- )
- (i32.const 15)
- )
- (local.tee $9
- (loop $label$63 (result i64)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (v128.const i32x4 0x80000000 0x1e1e141e 0x00008000 0x000e010b)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block (result i64)
- (local.set $9
- (local.get $3)
- )
- (br_if $label$63
- (i32.const -256)
- )
- (block $label$64 (result i64)
- (local.set $16
- (f64.const 2147483648)
- )
- (local.get $1)
- )
- )
- )
- )
+ (block $label$74
+ (local.set $4
+ (v128.const i32x4 0xf8f8ff00 0x000000a5 0x0000000e 0xffff00ff)
)
+ (br $label$73)
)
)
- (return
- (local.get $4)
- )
)
)
+ (i32.const -131072)
+ )
+ )
+ )
+ )
+ (if (result i32)
+ (local.get $2)
+ (block $label$75
+ (call $log-i32
+ (local.tee $2
+ (i32.const 5)
)
)
+ (br $label$49)
+ )
+ (block $label$76 (result i32)
+ (nop)
+ (local.tee $2
+ (i32.const 1276448839)
+ )
)
)
)
)
+ (local.set $2
+ (local.get $2)
+ )
+ )
+ )
+ (loop $label$90
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
)
- (local.tee $13
- (local.tee $11
- (block $label$65
- (local.set $16
- (f64.const 5.487989131676445e-139)
+ (block
+ (local.set $1
+ (local.get $1)
+ )
+ (br_if $label$90
+ (i32.eqz
+ (local.tee $2
+ (i32.const -93)
)
- (br $label$44)
)
)
+ (nop)
)
)
+ (local.get $2)
)
)
- (local.set $5
- (local.get $5)
+ (block $label$91 (result i32)
+ (local.set $5
+ (block $label$92 (result f32)
+ (local.set $1
+ (loop $label$19 (result f64)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result f64)
+ (nop)
+ (br_if $label$19
+ (i32.eqz
+ (i32.const -129)
+ )
+ )
+ (local.tee $1
+ (f64.const -nan:0xffffffffffff0)
+ )
+ )
+ )
+ )
+ (local.get $5)
+ )
+ )
+ (local.get $2)
)
- (local.set $11
- (local.get $11)
+ (block $label$95 (result i32)
+ (local.get $2)
)
)
)
- (unreachable)
+ (local.get $4)
+ (block $label$96 (result v128)
+ (v128.const i32x4 0x80800000 0xdf800000 0xcf000000 0x4f800000)
+ )
)
)
)
)
- (func $hangLimitInitializer (; 11 ;)
+ (func $hangLimitInitializer (; 6 ;)
(global.set $hangLimit
(i32.const 10)
)
diff --git a/test/passes/translate-to-fuzz_all-features.wast b/test/passes/translate-to-fuzz_all-features.wast
index 5b378f2b2..ae1761899 100644
--- a/test/passes/translate-to-fuzz_all-features.wast
+++ b/test/passes/translate-to-fuzz_all-features.wast
@@ -1,4 +1,4 @@
-(module # fake module here, for test harness, but it's really not needed
+(module # fake module here, for test harness, but it is really not needed
..
any
3INPUT
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 294b4f986..57afb02b7 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,35 +1,24 @@
(module
(type $FUNCSIG$i (func (result i32)))
+ (type $FUNCSIG$vifidi (func (param i32 f32 i32 f64 i32)))
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$vj (func (param i64)))
(type $FUNCSIG$vf (func (param f32)))
(type $FUNCSIG$vd (func (param f64)))
- (type $FUNCSIG$vjVdddV (func (param i64 v128 f64 f64 f64 v128)))
- (type $FUNCSIG$ddVff (func (param f64 v128 f32 f32) (result f64)))
- (type $FUNCSIG$VdVjf (func (param f64 v128 i64 f32) (result v128)))
- (type $FUNCSIG$v (func))
- (type $FUNCSIG$jjiV (func (param i64 i32 v128) (result i64)))
- (type $FUNCSIG$VVjj (func (param v128 i64 i64) (result v128)))
(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)))
- (memory $0 1 1)
+ (memory $0 (shared 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 8 8 funcref)
- (elem (i32.const 0) $func_6 $func_6 $func_6 $func_6 $func_9 $func_9 $func_9 $func_9)
- (global $global$0 (mut i32) (i32.const 975664160))
- (global $global$1 (mut i32) (i32.const -536870912))
- (global $global$2 (mut f32) (f32.const 2147483648))
- (global $global$3 (mut f32) (f32.const 1448959360))
+ (table $0 0 funcref)
+ (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 $hangLimit (mut i32) (i32.const 10))
+ (event $event$0 (attr 0) (param i32 f32 i32 f64 i32))
(export "hashMemory" (func $hashMemory))
- (export "func_5" (func $func_5))
- (export "func_6" (func $func_6))
- (export "func_7" (func $func_7))
- (export "func_7_invoker" (func $func_7_invoker))
- (export "func_9" (func $func_9))
- (export "func_10" (func $func_10))
(export "hangLimitInitializer" (func $hangLimitInitializer))
(func $hashMemory (; 4 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
@@ -262,7 +251,12 @@
)
(local.get $0)
)
- (func $func_5 (; 5 ;) (type $FUNCSIG$vjVdddV) (param $0 i64) (param $1 v128) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 v128)
+ (func $func_5 (; 5 ;) (param $0 i64)
+ (local $1 f64)
+ (local $2 i32)
+ (local $3 i64)
+ (local $4 v128)
+ (local $5 f32)
(block
(if
(i32.eqz
@@ -278,173 +272,612 @@
)
)
(block $label$0
- (call $log-f64
- (loop $label$1 (result f64)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return)
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
+ (br_if $label$0
+ (i32.eqz
+ (local.tee $2
+ (local.tee $2
+ (local.tee $2
+ (local.tee $2
+ (local.get $2)
+ )
)
)
)
- (block $label$2 (result f64)
- (call $log-i32
- (call $hashMemory)
- )
- (local.get $2)
- )
- )
- )
- (call $log-i32
- (call $hashMemory)
- )
- )
- )
- (func $func_6 (; 6 ;) (type $FUNCSIG$ddVff) (param $0 f64) (param $1 v128) (param $2 f32) (param $3 f32) (result f64)
- (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 (result f64)
- (call $log-i32
- (i32.const 84215045)
- )
- (f64.const 8)
- )
- )
- (func $func_7 (; 7 ;) (type $FUNCSIG$VdVjf) (param $0 f64) (param $1 v128) (param $2 i64) (param $3 f32) (result v128)
- (local $4 i32)
- (local $5 f64)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (local.get $1)
)
)
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (local.tee $1
- (local.tee $1
- (v128.const i32x4 0x6d484708 0x13e740fc 0x5849037f 0xe4000000)
- )
- )
- )
- (func $func_7_invoker (; 8 ;) (type $FUNCSIG$v)
- (drop
- (call $func_7
- (f64.const 16986)
- (v128.const i32x4 0x00000000 0x00000010 0xffffe000 0xffffffff)
- (i64.const -12)
- (f32.const 7243)
- )
- )
- (drop
- (call $func_7
- (f64.const -65536)
- (v128.const i32x4 0x00007d1f 0x00000200 0xffff0000 0x7fffffff)
- (i64.const 288230376151711744)
- (f32.const 128)
- )
- )
- (call $log-i32
- (call $hashMemory)
- )
- (drop
- (call $func_7
- (f64.const 0)
- (v128.const i32x4 0x00000000 0x403a0000 0x00000000 0xb8100000)
- (i64.const 66)
- (f32.const 0)
- )
- )
- )
- (func $func_9 (; 9 ;) (type $FUNCSIG$jjiV) (param $0 i64) (param $1 i32) (param $2 v128) (result i64)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (local.get $0)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
- )
- )
- )
- (i64.const 8)
- )
- (func $func_10 (; 10 ;) (type $FUNCSIG$VVjj) (param $0 v128) (param $1 i64) (param $2 i64) (result v128)
- (local $3 i64)
- (local $4 v128)
- (local $5 f64)
- (local $6 f32)
- (local $7 v128)
- (local $8 f64)
- (local $9 i64)
- (local $10 f32)
- (local $11 i32)
- (local $12 f32)
- (local $13 i32)
- (local $14 v128)
- (local $15 v128)
- (local $16 f64)
- (block
- (if
- (i32.eqz
- (global.get $hangLimit)
- )
- (return
- (local.get $14)
- )
- )
- (global.set $hangLimit
- (i32.sub
- (global.get $hangLimit)
- (i32.const 1)
+ (local.set $4
+ (v128.const i32x4 0x0e0a0e0d 0x0709060c 0x764b6f6f 0x00040000)
+ )
+ (local.set $4
+ (if (result v128)
+ (i32.eqz
+ (if (result i32)
+ (if (result i32)
+ (i32.eqz
+ (if (result i32)
+ (i32.eqz
+ (if
+ (i32.eqz
+ (if (result i32)
+ (i32.eqz
+ (if (result i32)
+ (i32.eqz
+ (if (result i32)
+ (local.get $2)
+ (loop $label$1 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result i32)
+ (block $label$2
+ (local.set $3
+ (i64.const 15662)
+ )
+ (local.set $2
+ (local.get $2)
+ )
+ )
+ (br_if $label$1
+ (local.get $2)
+ )
+ (if (result i32)
+ (i32.eqz
+ (local.get $2)
+ )
+ (local.get $2)
+ (local.get $2)
+ )
+ )
+ )
+ (block $label$3 (result i32)
+ (local.tee $2
+ (i32.const 286267661)
+ )
+ )
+ )
+ )
+ (block $label$4
+ (loop $label$5
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block
+ (block $label$6
+ (if
+ (i32.eqz
+ (loop $label$7 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i32.const 6506)
+ )
+ )
+ (block $label$8
+ (local.set $2
+ (local.tee $2
+ (local.get $2)
+ )
+ )
+ (local.set $5
+ (local.get $5)
+ )
+ )
+ (block $label$9
+ (if
+ (local.tee $2
+ (if (result i32)
+ (local.get $2)
+ (local.get $2)
+ (loop $label$10 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result i32)
+ (nop)
+ (br_if $label$10
+ (i32.eqz
+ (i32.const 64)
+ )
+ )
+ (local.tee $2
+ (loop $label$11 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i32.const 512)
+ )
+ )
+ )
+ )
+ )
+ )
+ (local.set $3
+ (local.get $3)
+ )
+ (loop $label$12
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (local.set $1
+ (local.get $1)
+ )
+ )
+ )
+ (local.set $2
+ (i32.const 170)
+ )
+ )
+ )
+ (call $log-i32
+ (local.get $2)
+ )
+ )
+ (br_if $label$5
+ (i32.eqz
+ (i32.const 2376257)
+ )
+ )
+ (local.set $4
+ (local.tee $4
+ (v128.const i32x4 0xfff70000 0x007f700e 0x07420400 0x8000007f)
+ )
+ )
+ )
+ )
+ (block $label$13
+ (if
+ (i32.eqz
+ (block $label$14 (result i32)
+ (local.set $4
+ (v128.const i32x4 0x80000000 0x00000080 0xfffffffc 0x00007fff)
+ )
+ (i32.const -123)
+ )
+ )
+ (local.set $1
+ (local.get $1)
+ )
+ (local.set $5
+ (local.get $5)
+ )
+ )
+ (br $label$0)
+ )
+ )
+ (block $label$17 (result i32)
+ (i64.atomic.store offset=3
+ (i32.const 640629291)
+ (local.tee $0
+ (i64.const -16)
+ )
+ )
+ (if (result i32)
+ (block $label$18
+ (local.set $1
+ (loop $label$19 (result f64)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result f64)
+ (nop)
+ (br_if $label$19
+ (i32.eqz
+ (local.get $2)
+ )
+ )
+ (local.tee $1
+ (f64.const 0)
+ )
+ )
+ )
+ )
+ (return)
+ )
+ (local.tee $2
+ (local.get $2)
+ )
+ (block $label$20
+ (loop $label$21
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (local.set $1
+ (local.get $1)
+ )
+ )
+ (return)
+ )
+ )
+ )
+ )
+ )
+ (block $label$22 (result i32)
+ (local.set $5
+ (f32.const 10160664)
+ )
+ (if (result i32)
+ (i32.eqz
+ (i32.const 0)
+ )
+ (block $label$23
+ (local.set $1
+ (loop $label$24 (result f64)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result f64)
+ (local.set $3
+ (local.get $0)
+ )
+ (br_if $label$24
+ (i32.const -9)
+ )
+ (f64.const -18446744073709551615)
+ )
+ )
+ )
+ (br $label$0)
+ )
+ (block $label$25 (result i32)
+ (loop $label$26
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block
+ (local.set $2
+ (local.get $2)
+ )
+ (br_if $label$26
+ (i32.eqz
+ (if (result i32)
+ (br_if $label$25
+ (i32.const -8)
+ (local.get $2)
+ )
+ (local.get $2)
+ (block $label$29 (result i32)
+ (call $log-i32
+ (call $hashMemory)
+ )
+ (loop $label$30 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (local.get $2)
+ )
+ )
+ )
+ )
+ )
+ (local.set $5
+ (local.get $5)
+ )
+ )
+ )
+ (local.get $2)
+ )
+ )
+ )
+ (block $label$35
+ (local.set $1
+ (f64.const 1414944843)
+ )
+ (br $label$0)
+ )
+ )
+ )
+ (local.tee $2
+ (local.tee $2
+ (loop $label$38
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (if
+ (i32.eqz
+ (local.get $2)
+ )
+ (block $label$39
+ (nop)
+ (br $label$0)
+ )
+ (block $label$40
+ (local.set $1
+ (local.get $1)
+ )
+ (br $label$0)
+ )
+ )
+ )
+ )
+ )
+ (block $label$41
+ (memory.copy
+ (loop $label$42 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (if (result i32)
+ (loop $label$43 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$44 (result i32)
+ (local.set $3
+ (i64.const 2097574720517510216)
+ )
+ (if (result i32)
+ (i32.eqz
+ (local.get $2)
+ )
+ (i32.const 1296450369)
+ (local.tee $2
+ (i32.const -14)
+ )
+ )
+ )
+ )
+ (block $label$45
+ (local.set $2
+ (i32.const 235407412)
+ )
+ (br $label$0)
+ )
+ (block $label$46 (result i32)
+ (local.set $2
+ (local.tee $2
+ (local.tee $2
+ (local.tee $2
+ (i32.const 1179009606)
+ )
+ )
+ )
+ )
+ (i32.const 1073741824)
+ )
+ )
+ )
+ (local.get $2)
+ (i32.const 1073741824)
+ )
+ (return)
+ )
+ )
+ )
+ (local.get $2)
+ (local.get $2)
+ )
+ )
+ (block $label$47
+ (local.set $2
+ (local.get $2)
+ )
+ (br $label$0)
+ )
+ (block $label$48 (result i32)
+ (loop $label$49
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (local.set $5
+ (local.get $5)
+ )
+ )
+ (loop $label$90
+ (block
+ (if
+ (i32.eqz
+ (global.get $hangLimit)
+ )
+ (return)
+ )
+ (global.set $hangLimit
+ (i32.sub
+ (global.get $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block
+ (local.set $1
+ (local.get $1)
+ )
+ (local.set $2
+ (local.get $2)
+ )
+ (nop)
+ )
+ )
+ (local.get $2)
+ )
+ )
+ (block $label$91 (result i32)
+ (local.set $5
+ (block $label$92 (result f32)
+ (f32.const 6)
+ )
+ )
+ (local.get $2)
+ )
+ (local.get $2)
+ )
+ )
+ (v128.const i32x4 0xffffffc0 0x00001f16 0x00008000 0x505c1a13)
+ (v128.const i32x4 0xc7007b11 0x721d0901 0x01810043 0x441f1201)
)
)
)
- (return
- (local.get $14)
- )
)
- (func $hangLimitInitializer (; 11 ;)
+ (func $hangLimitInitializer (; 6 ;)
(global.set $hangLimit
(i32.const 10)
)
)
- (func $deNan32 (; 12 ;) (param $0 f32) (result f32)
+ (func $deNan32 (; 7 ;) (param $0 f32) (result f32)
(if (result f32)
(f32.eq
(local.get $0)
@@ -454,7 +887,7 @@
(f32.const 0)
)
)
- (func $deNan64 (; 13 ;) (param $0 f64) (result f64)
+ (func $deNan64 (; 8 ;) (param $0 f64) (result f64)
(if (result f64)
(f64.eq
(local.get $0)
diff --git a/test/passes/translate-to-fuzz_no-fuzz-nans_all-features.wast b/test/passes/translate-to-fuzz_no-fuzz-nans_all-features.wast
index cbf25fde1..3dab8874e 100644
--- a/test/passes/translate-to-fuzz_no-fuzz-nans_all-features.wast
+++ b/test/passes/translate-to-fuzz_no-fuzz-nans_all-features.wast
@@ -1,4 +1,4 @@
-(module # fake module here, for test harness, but it's really not needed
+(module # fake module here, for test harness, but it is really not needed
..
any
3INPUT