summaryrefslogtreecommitdiff
path: root/test/passes/optimize-instructions_fuzz-exec.txt
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-10-30 11:36:52 -0700
committerGitHub <noreply@github.com>2020-10-30 11:36:52 -0700
commitebaddfbd09359a9de6424e0c302255b8f8caf6f6 (patch)
treef7a0ee4e3aa6217d70f37c729f937e12e8ece7f1 /test/passes/optimize-instructions_fuzz-exec.txt
parent253c6a50130a16a1a1aae80bba4885fe99d3f625 (diff)
downloadbinaryen-ebaddfbd09359a9de6424e0c302255b8f8caf6f6.tar.gz
binaryen-ebaddfbd09359a9de6424e0c302255b8f8caf6f6.tar.bz2
binaryen-ebaddfbd09359a9de6424e0c302255b8f8caf6f6.zip
Standardize NaNs in the interpreter, when there is nondeterminism (#3298)
Specifically, pick a simple positive canonical NaN as the NaN output, when the output is a NaN. This is the same as what tools like wabt do. This fixes a testcase found by the fuzzer on #3289 but it was not that PR's fault.
Diffstat (limited to 'test/passes/optimize-instructions_fuzz-exec.txt')
-rw-r--r--test/passes/optimize-instructions_fuzz-exec.txt255
1 files changed, 255 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions_fuzz-exec.txt b/test/passes/optimize-instructions_fuzz-exec.txt
new file mode 100644
index 000000000..548148e09
--- /dev/null
+++ b/test/passes/optimize-instructions_fuzz-exec.txt
@@ -0,0 +1,255 @@
+[fuzz-exec] calling test32
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x7fff82]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[fuzz-exec] calling test64
+[LoggingExternalInterface logging nan:0x8000000000000]
+[LoggingExternalInterface logging nan:0x8000000000000]
+[LoggingExternalInterface logging nan:0x8000000000000]
+[LoggingExternalInterface logging nan:0x8000000000000]
+[LoggingExternalInterface logging nan:0xfffffffffff82]
+[LoggingExternalInterface logging nan:0x8000000000000]
+[LoggingExternalInterface logging nan:0x8000000000000]
+[fuzz-exec] calling just-one-nan
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[fuzz-exec] calling ignore
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+(module
+ (type $none_=>_none (func))
+ (type $f32_=>_none (func (param f32)))
+ (type $f64_=>_none (func (param f64)))
+ (import "fuzzing-support" "log-f32" (func $logf32 (param f32)))
+ (import "fuzzing-support" "log-f64" (func $logf64 (param f64)))
+ (export "test32" (func $0))
+ (export "test64" (func $1))
+ (export "just-one-nan" (func $2))
+ (export "ignore" (func $3))
+ (func $0
+ (call $logf32
+ (f32.add
+ (f32.const -nan:0x7fff82)
+ (f32.neg
+ (f32.const -nan:0x7ff622)
+ )
+ )
+ )
+ (call $logf32
+ (f32.sub
+ (f32.const -nan:0x7fff82)
+ (f32.neg
+ (f32.const -nan:0x7ff622)
+ )
+ )
+ )
+ (call $logf32
+ (f32.mul
+ (f32.const -nan:0x7fff82)
+ (f32.neg
+ (f32.const -nan:0x7ff622)
+ )
+ )
+ )
+ (call $logf32
+ (f32.div
+ (f32.const nan:0x7fff82)
+ (f32.const -nan:0x7ff622)
+ )
+ )
+ (call $logf32
+ (f32.copysign
+ (f32.const -nan:0x7fff82)
+ (f32.neg
+ (f32.const -nan:0x7ff622)
+ )
+ )
+ )
+ (call $logf32
+ (f32.min
+ (f32.const -nan:0x7fff82)
+ (f32.neg
+ (f32.const -nan:0x7ff622)
+ )
+ )
+ )
+ (call $logf32
+ (f32.max
+ (f32.const -nan:0x7fff82)
+ (f32.neg
+ (f32.const -nan:0x7ff622)
+ )
+ )
+ )
+ )
+ (func $1
+ (call $logf64
+ (f64.add
+ (f64.const -nan:0xfffffffffff82)
+ (f64.neg
+ (f64.const -nan:0xfffffffffa622)
+ )
+ )
+ )
+ (call $logf64
+ (f64.sub
+ (f64.const -nan:0xfffffffffff82)
+ (f64.neg
+ (f64.const -nan:0xfffffffffa622)
+ )
+ )
+ )
+ (call $logf64
+ (f64.mul
+ (f64.const -nan:0xfffffffffff82)
+ (f64.neg
+ (f64.const -nan:0xfffffffffa622)
+ )
+ )
+ )
+ (call $logf64
+ (f64.div
+ (f64.const nan:0xfffffffffff82)
+ (f64.const -nan:0xfffffffffa622)
+ )
+ )
+ (call $logf64
+ (f64.copysign
+ (f64.const -nan:0xfffffffffff82)
+ (f64.neg
+ (f64.const -nan:0xfffffffffa622)
+ )
+ )
+ )
+ (call $logf64
+ (f64.min
+ (f64.const -nan:0xfffffffffff82)
+ (f64.neg
+ (f64.const -nan:0xfffffffffa622)
+ )
+ )
+ )
+ (call $logf64
+ (f64.max
+ (f64.const -nan:0xfffffffffff82)
+ (f64.neg
+ (f64.const -nan:0xfffffffffa622)
+ )
+ )
+ )
+ )
+ (func $2
+ (call $logf32
+ (f32.add
+ (f32.neg
+ (f32.const -nan:0x7ff622)
+ )
+ (f32.const 0)
+ )
+ )
+ (call $logf32
+ (f32.add
+ (f32.const -nan:0x7ff622)
+ (f32.neg
+ (f32.const 0)
+ )
+ )
+ )
+ (call $logf32
+ (f32.add
+ (f32.neg
+ (f32.const -nan:0x7ff622)
+ )
+ (f32.const -0)
+ )
+ )
+ (call $logf32
+ (f32.add
+ (f32.const -nan:0x7ff622)
+ (f32.neg
+ (f32.const -0)
+ )
+ )
+ )
+ (call $logf32
+ (f32.add
+ (f32.neg
+ (f32.const nan:0x7ff622)
+ )
+ (f32.const 0)
+ )
+ )
+ (call $logf32
+ (f32.add
+ (f32.const nan:0x7ff622)
+ (f32.neg
+ (f32.const 0)
+ )
+ )
+ )
+ )
+ (func $3
+ (call $logf32
+ (f32.div
+ (f32.const -0)
+ (f32.const 0)
+ )
+ )
+ (call $logf32
+ (f32.div
+ (f32.const 0)
+ (f32.const 0)
+ )
+ )
+ (call $logf32
+ (f32.div
+ (f32.const -0)
+ (f32.const -0)
+ )
+ )
+ (call $logf32
+ (f32.div
+ (f32.const 0)
+ (f32.const -0)
+ )
+ )
+ )
+)
+[fuzz-exec] calling test32
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x7fff82]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[fuzz-exec] calling test64
+[LoggingExternalInterface logging nan:0x8000000000000]
+[LoggingExternalInterface logging nan:0x8000000000000]
+[LoggingExternalInterface logging nan:0x8000000000000]
+[LoggingExternalInterface logging nan:0x8000000000000]
+[LoggingExternalInterface logging nan:0xfffffffffff82]
+[LoggingExternalInterface logging nan:0x8000000000000]
+[LoggingExternalInterface logging nan:0x8000000000000]
+[fuzz-exec] calling just-one-nan
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[fuzz-exec] calling ignore
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]
+[LoggingExternalInterface logging nan:0x400000]