diff options
Diffstat (limited to 'test/passes')
-rw-r--r-- | test/passes/emit-js-wrapper=a.js.txt | 42 | ||||
-rw-r--r-- | test/passes/emit-js-wrapper=a.js.wast | 37 | ||||
-rw-r--r-- | test/passes/emit-js-wrapper=a.js.wast.js | 44 | ||||
-rw-r--r-- | test/passes/emit-spec-wrapper=a.wat.txt | 42 | ||||
-rw-r--r-- | test/passes/emit-spec-wrapper=a.wat.wast | 37 | ||||
-rw-r--r-- | test/passes/emit-spec-wrapper=a.wat.wast.wat | 1 | ||||
-rw-r--r-- | test/passes/fuzz-exec_O.txt | 8 | ||||
-rw-r--r-- | test/passes/translate-to-fuzz.txt | 1126 | ||||
-rw-r--r-- | test/passes/translate-to-fuzz.wast | 99 |
9 files changed, 1435 insertions, 1 deletions
diff --git a/test/passes/emit-js-wrapper=a.js.txt b/test/passes/emit-js-wrapper=a.js.txt new file mode 100644 index 000000000..0432ccdc7 --- /dev/null +++ b/test/passes/emit-js-wrapper=a.js.txt @@ -0,0 +1,42 @@ +(module + (type $0 (func (param i32 i32) (result i32))) + (type $1 (func (param i32))) + (type $2 (func (param i32 i64 f32 f64))) + (type $3 (func (param i32 f32 f64))) + (type $4 (func (param i32 f32 f64) (result i64))) + (memory $0 256 256) + (export "add" (func $add)) + (export "no_return" (func $no-return)) + (export "types" (func $types)) + (export "types2" (func $types2)) + (export "types3" (func $types3)) + (func $add (type $0) (param $x i32) (param $y i32) (result i32) + (i32.add + (get_local $x) + (get_local $y) + ) + ) + (func $unexported (type $0) (param $x i32) (param $y i32) (result i32) + (i32.add + (get_local $x) + (get_local $y) + ) + ) + (func $no-return (type $1) (param $x i32) + (drop + (i32.add + (get_local $x) + (get_local $x) + ) + ) + ) + (func $types (type $2) (param $x i32) (param $y i64) (param $z f32) (param $w f64) + (nop) + ) + (func $types2 (type $3) (param $x i32) (param $z f32) (param $w f64) + (nop) + ) + (func $types3 (type $4) (param $x i32) (param $z f32) (param $w f64) (result i64) + (i64.const 1) + ) +) diff --git a/test/passes/emit-js-wrapper=a.js.wast b/test/passes/emit-js-wrapper=a.js.wast new file mode 100644 index 000000000..4ea764b61 --- /dev/null +++ b/test/passes/emit-js-wrapper=a.js.wast @@ -0,0 +1,37 @@ +(module + (memory $0 256 256) + (export "add" (func $add)) + (export "no_return" (func $no-return)) ;; note exported name is slightly different + (export "types" (func $types)) + (export "types2" (func $types2)) + (export "types3" (func $types3)) + (func $add (param $x i32) (param $y i32) (result i32) + (i32.add + (get_local $x) + (get_local $y) + ) + ) + (func $unexported (param $x i32) (param $y i32) (result i32) + (i32.add + (get_local $x) + (get_local $y) + ) + ) + (func $no-return (param $x i32) + (drop + (i32.add + (get_local $x) + (get_local $x) + ) + ) + ) + (func $types (param $x i32) (param $y i64) (param $z f32) (param $w f64) + (nop) + ) + (func $types2 (param $x i32) (param $z f32) (param $w f64) + (nop) + ) + (func $types3 (param $x i32) (param $z f32) (param $w f64) (result i64) + (i64.const 1) + ) +) diff --git a/test/passes/emit-js-wrapper=a.js.wast.js b/test/passes/emit-js-wrapper=a.js.wast.js new file mode 100644 index 000000000..778f43827 --- /dev/null +++ b/test/passes/emit-js-wrapper=a.js.wast.js @@ -0,0 +1,44 @@ +if (typeof console === 'undefined') { + console = { log: print }; +} +var binary; +if (typeof process === 'object' && typeof require === 'function' /* node.js detection */) { + var args = process.argv.slice(2); + binary = require('fs').readFileSync(args[0]); + if (!binary.buffer) binary = new Uint8Array(binary); +} else { + var args; + if (typeof scriptArgs != 'undefined') { + args = scriptArgs; + } else if (typeof arguments != 'undefined') { + args = arguments; + } + if (typeof readbuffer === 'function') { + binary = new Uint8Array(readbuffer(args[0])); + } else { + binary = read(args[0], 'binary'); + } +} +var instance = new WebAssembly.Instance(new WebAssembly.Module(binary), {}); +if (instance.exports.hangLimitInitializer) instance.exports.hangLimitInitializer(); +try { + console.log('calling: add'); + console.log(' result: ' + instance.exports.add(0, 0)); +} catch (e) { + console.log(' exception: ' + e); +} +if (instance.exports.hangLimitInitializer) instance.exports.hangLimitInitializer(); +try { + console.log('calling: no_return'); +instance.exports.no_return(0); +} catch (e) { + console.log(' exception: ' + e); +} +if (instance.exports.hangLimitInitializer) instance.exports.hangLimitInitializer(); +try { + console.log('calling: types2'); +instance.exports.types2(0, 0, 0); +} catch (e) { + console.log(' exception: ' + e); +} +console.log('done.') diff --git a/test/passes/emit-spec-wrapper=a.wat.txt b/test/passes/emit-spec-wrapper=a.wat.txt new file mode 100644 index 000000000..0432ccdc7 --- /dev/null +++ b/test/passes/emit-spec-wrapper=a.wat.txt @@ -0,0 +1,42 @@ +(module + (type $0 (func (param i32 i32) (result i32))) + (type $1 (func (param i32))) + (type $2 (func (param i32 i64 f32 f64))) + (type $3 (func (param i32 f32 f64))) + (type $4 (func (param i32 f32 f64) (result i64))) + (memory $0 256 256) + (export "add" (func $add)) + (export "no_return" (func $no-return)) + (export "types" (func $types)) + (export "types2" (func $types2)) + (export "types3" (func $types3)) + (func $add (type $0) (param $x i32) (param $y i32) (result i32) + (i32.add + (get_local $x) + (get_local $y) + ) + ) + (func $unexported (type $0) (param $x i32) (param $y i32) (result i32) + (i32.add + (get_local $x) + (get_local $y) + ) + ) + (func $no-return (type $1) (param $x i32) + (drop + (i32.add + (get_local $x) + (get_local $x) + ) + ) + ) + (func $types (type $2) (param $x i32) (param $y i64) (param $z f32) (param $w f64) + (nop) + ) + (func $types2 (type $3) (param $x i32) (param $z f32) (param $w f64) + (nop) + ) + (func $types3 (type $4) (param $x i32) (param $z f32) (param $w f64) (result i64) + (i64.const 1) + ) +) diff --git a/test/passes/emit-spec-wrapper=a.wat.wast b/test/passes/emit-spec-wrapper=a.wat.wast new file mode 100644 index 000000000..4ea764b61 --- /dev/null +++ b/test/passes/emit-spec-wrapper=a.wat.wast @@ -0,0 +1,37 @@ +(module + (memory $0 256 256) + (export "add" (func $add)) + (export "no_return" (func $no-return)) ;; note exported name is slightly different + (export "types" (func $types)) + (export "types2" (func $types2)) + (export "types3" (func $types3)) + (func $add (param $x i32) (param $y i32) (result i32) + (i32.add + (get_local $x) + (get_local $y) + ) + ) + (func $unexported (param $x i32) (param $y i32) (result i32) + (i32.add + (get_local $x) + (get_local $y) + ) + ) + (func $no-return (param $x i32) + (drop + (i32.add + (get_local $x) + (get_local $x) + ) + ) + ) + (func $types (param $x i32) (param $y i64) (param $z f32) (param $w f64) + (nop) + ) + (func $types2 (param $x i32) (param $z f32) (param $w f64) + (nop) + ) + (func $types3 (param $x i32) (param $z f32) (param $w f64) (result i64) + (i64.const 1) + ) +) diff --git a/test/passes/emit-spec-wrapper=a.wat.wast.wat b/test/passes/emit-spec-wrapper=a.wat.wast.wat new file mode 100644 index 000000000..20cdac9b2 --- /dev/null +++ b/test/passes/emit-spec-wrapper=a.wat.wast.wat @@ -0,0 +1 @@ +(invoke "hangLimitInitializer") (invoke "add" (i32.const 0) (i32.const 0) ) (invoke "hangLimitInitializer") (invoke "no_return" (i32.const 0) ) (invoke "hangLimitInitializer") (invoke "types" (i32.const 0) (i64.const 0) (f32.const 0) (f64.const 0) ) (invoke "hangLimitInitializer") (invoke "types2" (i32.const 0) (f32.const 0) (f64.const 0) ) (invoke "hangLimitInitializer") (invoke "types3" (i32.const 0) (f32.const 0) (f64.const 0) )
\ No newline at end of file diff --git a/test/passes/fuzz-exec_O.txt b/test/passes/fuzz-exec_O.txt index f5f8583a3..bb6796494 100644 --- a/test/passes/fuzz-exec_O.txt +++ b/test/passes/fuzz-exec_O.txt @@ -1,3 +1,5 @@ +[fuzz-exec] note result: func_0 => (none.const ?) +[fuzz-exec] note result: func_1 => (none.const ?) [fuzz-exec] 2 results noted (module (type $0 (func (result i64))) @@ -21,5 +23,9 @@ ) ) ) +[fuzz-exec] note result: func_0 => (none.const ?) +[fuzz-exec] note result: func_1 => (none.const ?) [fuzz-exec] 2 results noted -[fuzz-exec] results match +[fuzz-exec] comparing $func_0 +[fuzz-exec] comparing $func_1 +[fuzz-exec] 2 results match diff --git a/test/passes/translate-to-fuzz.txt b/test/passes/translate-to-fuzz.txt new file mode 100644 index 000000000..daab102ad --- /dev/null +++ b/test/passes/translate-to-fuzz.txt @@ -0,0 +1,1126 @@ +(module + (global $hangLimit (mut i32) (i32.const 25)) + (memory $0 1 1) + (export "func_0" (func $func_0)) + (export "func_1" (func $func_1)) + (export "func_4" (func $func_4)) + (export "func_5" (func $func_5)) + (export "hangLimitInitializer" (func $hangLimitInitializer)) + (func $func_0 (result i32) + (local $0 f32) + (local $1 i64) + (local $2 f32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const -118) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$0 (result i32) + (if + (loop $label$1 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const 127) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (select + (i64.ne + (if (result i64) + (i32.eqz + (loop $label$5 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const 190) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$6 (result i32) + (i32.const 104) + ) + ) + ) + (block $label$7 (result i64) + (return + (i32.const 387928603) + ) + ) + (block $label$8 (result i64) + (br $label$1) + ) + ) + (i64.const -1) + ) + (br_if $label$0 + (br_if $label$0 + (i32.popcnt + (i32.const 75) + ) + (i32.eqz + (select + (if (result i32) + (loop $label$9 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const 828535924) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$10 (result i32) + (block $label$11 + (set_local $1 + (get_local $1) + ) + ) + (br $label$1) + ) + ) + (block $label$12 (result i32) + (i32.const 1767927669) + ) + (block $label$13 (result i32) + (if (result i32) + (i32.const -32768) + (i32.const 127) + (i32.const 269491029) + ) + ) + ) + (if (result i32) + (i32.eqz + (loop $label$14 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const -71) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$15 (result i32) + (br $label$1) + ) + ) + ) + (block $label$16 (result i32) + (br $label$1) + ) + (i32.ge_u + (br_if $label$0 + (i32.const -98) + (i32.const 65419) + ) + (i32.load offset=22 align=1 + (i32.and + (i32.const 0) + (i32.const 31) + ) + ) + ) + ) + (br_if $label$0 + (i32.load offset=22 + (i32.and + (i32.const -1) + (i32.const 31) + ) + ) + (i32.const 1561467741) + ) + ) + ) + ) + (i32.const 32767) + ) + (br_if $label$0 + (loop $label$2 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const 469762305) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$3 (result i32) + (i32.popcnt + (select + (br_if $label$0 + (i32.const 573448231) + (select + (i32.const 1917992040) + (i32.const -25) + (i32.const -105) + ) + ) + (i32.const 65535) + (br_if $label$3 + (i32.lt_u + (select + (select + (br_if $label$3 + (i32.const 188) + (i32.const 1) + ) + (loop $label$4 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const 255) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (i32.const 65448) + ) + (i32.const 31021) + ) + (i32.const 1562845246) + (i32.const 1) + ) + (i32.const 2147483647) + ) + (i32.const 127) + ) + ) + ) + ) + ) + (i32.eqz + (i32.const -1) + ) + ) + ) + ) + (block $label$17 + (if + (i32.eqz + (select + (i64.gt_s + (tee_local $1 + (if (result i64) + (select + (select + (br_if $label$0 + (i32.const 4) + (i32.const 1) + ) + (br_if $label$0 + (i32.const -120) + (i32.const 26) + ) + (i32.const 32767) + ) + (select + (i32.const 909534506) + (i32.const 6424) + (select + (i32.const -2147483648) + (i32.const -1) + (i32.const 32767) + ) + ) + (i32.const 1) + ) + (block $label$19 (result i64) + (i64.extend_u/i32 + (i32.const 255) + ) + ) + (block $label$20 (result i64) + (if (result i64) + (block $label$21 (result i32) + (block $label$22 (result i32) + (i32.const -42) + ) + ) + (i64.div_s + (i64.const -9223372036854775808) + (loop $label$23 (result i64) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const -15) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (get_local $1) + ) + ) + (if (result i64) + (select + (i32.const -20) + (i32.const 84) + (i32.const 706834235) + ) + (block $label$24 (result i64) + (br $label$17) + ) + (block $label$25 (result i64) + (return + (i32.const -44) + ) + ) + ) + ) + ) + ) + ) + (i64.popcnt + (block $label$26 (result i64) + (br $label$17) + ) + ) + ) + (i32.reinterpret/f32 + (block $label$27 (result f32) + (return + (i32.const 1112421928) + ) + ) + ) + (br_if $label$0 + (i32.const 18) + (block $label$18 (result i32) + (br $label$17) + ) + ) + ) + ) + (block $label$28 + (drop + (f32.const -2147483648) + ) + ) + (block $label$31 + (drop + (block $label$32 (result f64) + (f64.const 3777575208023997706127184e35) + ) + ) + (nop) + ) + ) + ) + (block $label$33 + (loop $label$34 + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const 73) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$35 + (loop $label$36 + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const 155802894) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (br_if $label$36 + (i32.eqz + (block $label$37 (result i32) + (i32.const -1) + ) + ) + ) + ) + ) + ) + ) + ) + (set_local $1 + (i64.trunc_s/f32 + (f32.const 18446744073709551615) + ) + ) + (return + (i32.const -57) + ) + ) + ) + (func $func_1 (param $0 i64) (param $1 i32) (result i64) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i64.const -40) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (call $func_1 + (tee_local $0 + (i64.shl + (if (result i64) + (i32.eqz + (tee_local $1 + (get_local $1) + ) + ) + (block $label$0 (result i64) + (return + (i64.const 18469) + ) + ) + (block $label$1 (result i64) + (return + (i64.const -1) + ) + ) + ) + (tee_local $0 + (tee_local $0 + (block $label$2 (result i64) + (block $label$3 (result i64) + (return + (i64.const 127) + ) + ) + ) + ) + ) + ) + ) + (get_local $1) + ) + ) + (func $func_2 + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (if + (i32.eqz + (if (result i32) + (i32.const 5662) + (block $label$0 (result i32) + (return) + ) + (block $label$1 (result i32) + (return) + ) + ) + ) + (nop) + (if + (i32.const 508363275) + (block $label$2 + (if + (i32.const -1) + (block $label$3 + (nop) + (nop) + ) + (block $label$4 + (loop $label$5 + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$6 + (if + (i32.eqz + (i64.eqz + (block $label$7 (result i64) + (block $label$8 (result i64) + (loop $label$9 (result i64) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (i64.const 5787412799727686208) + ) + ) + ) + ) + ) + (block $label$10 + (loop $label$11 + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$12 + (f64.store offset=4 + (i32.and + (i32.const 48) + (i32.const 31) + ) + (f64.const -nan:0xfffffffffffae) + ) + ) + ) + ) + (block $label$13 + (block $label$14 + (loop $label$15 + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$16 + (nop) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (block $label$17 + (br_if $label$17 + (i32.eqz + (if (result i32) + (if (result i32) + (select + (block $label$19 (result i32) + (i32.store offset=4 align=1 + (i32.and + (block $label$20 (result i32) + (i32.const 19534) + ) + (i32.const 31) + ) + (br_if $label$19 + (i32.const 488444703) + (i32.eqz + (i32.const -128) + ) + ) + ) + (select + (i32.const -97) + (i32.const -2147483648) + (i32.const -125) + ) + ) + (if (result i32) + (block $label$21 (result i32) + (br $label$17) + ) + (block $label$22 (result i32) + (i32.load16_u offset=22 + (select + (loop $label$23 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (i32.const 15448) + ) + (i32.rem_u + (i32.const 1026110509) + (i32.const 1) + ) + (i32.const 97) + ) + ) + ) + (block $label$24 (result i32) + (i32.trunc_u/f64 + (call $deNan64 + (select + (f64.const 6.013471909394168e-154) + (f64.const -nan:0xfffffffffffbb) + (call $func_0) + ) + ) + ) + ) + ) + (block $label$18 (result i32) + (br_if $label$18 + (i32.const -76) + (i32.eqz + (i32.clz + (i64.le_u + (i64.const 7) + (i64.const -30) + ) + ) + ) + ) + ) + ) + (i32.const -10) + (block $label$25 (result i32) + (loop $label$26 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (br_if $label$25 + (i32.const 32767) + (i32.eqz + (i32.load offset=4 align=1 + (i32.and + (i32.const 32767) + (i32.const 31) + ) + ) + ) + ) + ) + ) + ) + (block $label$27 (result i32) + (br $label$17) + ) + (block $label$28 (result i32) + (i32.const -124) + ) + ) + ) + ) + (block $label$29 + (loop $label$30 + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (loop $label$31 + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$32 + (loop $label$33 + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$34 + (block $label$35 + (drop + (f64.load offset=22 + (i32.and + (i32.const -31) + (i32.const 31) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (block $label$36 + (br_if $label$17 + (i32.eqz + (i32.const 1) + ) + ) + (block $label$37 + (block $label$38 + (block $label$39 + (block $label$40 + (block $label$41 + (nop) + ) + ) + ) + ) + ) + ) + ) + (nop) + ) + ) + ) + ) + (func $func_3 (result f32) + (local $0 i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (f32.const 3595217802362880) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (f32.const 1.1754943508222875e-38) + ) + (func $func_4 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const 11) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (i32.const 71) + ) + (func $func_5 (param $0 i64) (param $1 i32) (param $2 i32) (result i64) + (local $3 f32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i64.const -77) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (call $func_1 + (if (result i64) + (if (result i32) + (i32.ctz + (block $label$0 (result i32) + (return + (i64.const -94) + ) + ) + ) + (block $label$1 (result i32) + (return + (i64.const -71) + ) + ) + (block $label$2 (result i32) + (call $func_4) + ) + ) + (tee_local $0 + (select + (select + (loop $label$7 (result i64) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i64.const -9223372036854775808) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$8 (result i64) + (return + (i64.const 4627) + ) + ) + ) + (i64.sub + (i64.const 30983) + (if (result i64) + (i32.eqz + (i32.const -128) + ) + (block $label$9 (result i64) + (i64.rem_s + (i64.load offset=3 align=4 + (i32.and + (f32.le + (f32.load offset=4 + (i32.and + (i32.const -126) + (i32.const 31) + ) + ) + (tee_local $3 + (call $deNan32 + (select + (call $deNan32 + (f32.convert_s/i32 + (get_local $1) + ) + ) + (f32.const 7.458154094308611e-10) + (get_local $1) + ) + ) + ) + ) + (i32.const 31) + ) + ) + (block $label$10 (result i64) + (return + (i64.const -72) + ) + ) + ) + ) + (block $label$11 (result i64) + (return + (i64.const 106) + ) + ) + ) + ) + (i32.const 0) + ) + (loop $label$12 (result i64) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i64.const 65509) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$13 (result i64) + (return + (i64.const 127) + ) + ) + ) + (select + (f64.ge + (f64.const 1.1754943508222875e-38) + (if (result f64) + (f32.gt + (get_local $3) + (call $deNan32 + (f32.sub + (get_local $3) + (get_local $3) + ) + ) + ) + (block $label$3 (result f64) + (return + (i64.const 65457) + ) + ) + (block $label$4 (result f64) + (return + (i64.const 1011356149276677899) + ) + ) + ) + ) + (i32.reinterpret/f32 + (f32.load offset=2 align=2 + (i32.and + (select + (get_local $2) + (tee_local $2 + (get_local $2) + ) + (i32.load8_u offset=2 + (i32.and + (loop $label$5 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i64.const 0) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$6 (result i32) + (return + (i64.const -65) + ) + ) + ) + (i32.const 31) + ) + ) + ) + (i32.const 31) + ) + ) + ) + (i32.const 10853) + ) + ) + ) + (block $label$14 (result i64) + (block $label$15 + (nop) + ) + (return + (i64.const -89) + ) + ) + ) + (block $label$16 (result i32) + (block $label$17 + (nop) + ) + (nop) + (get_local $1) + ) + ) + ) + (func $hangLimitInitializer + (set_global $hangLimit + (i32.const 25) + ) + ) + (func $deNan32 (param $0 f32) (result f32) + (if (result f32) + (f32.eq + (get_local $0) + (get_local $0) + ) + (get_local $0) + (f32.const 0) + ) + ) + (func $deNan64 (param $0 f64) (result f64) + (if (result f64) + (f64.eq + (get_local $0) + (get_local $0) + ) + (get_local $0) + (f64.const 0) + ) + ) +) diff --git a/test/passes/translate-to-fuzz.wast b/test/passes/translate-to-fuzz.wast new file mode 100644 index 000000000..cbf25fde1 --- /dev/null +++ b/test/passes/translate-to-fuzz.wast @@ -0,0 +1,99 @@ +(module # fake module here, for test harness, but it's really not needed +.. +any +3INPUT +h e r e +*will* +d0 +0.753538467597066 +2.2339337309978227 +................. +lorem ipsum whatever + +through the darkness of future past +the magician longs to see +one [chants|chance] out between two worlds +fire, walk with me + + +h e r e +*will* +d0 +0.753538467597066 +2.2339337309978227 +................. +lorem ipsum whatever + +through the darkness of future past +the magician longs to see +one [chants|chance] out between two worlds +fire, walk with me + + +(&!*^@$*&@!^*&@#^$*&@#$*&@#$^*&@^#$)(&)(!&$(*&^@&#*$ + +MOAR testing09237861235980723894570389yfskdjhgfm13jo847rtnjcsjjdhfgnc12o387456vb1p98364vlaisutfvlKUYASDOV*&Q@$%VOUAYFROVLUKSYDFP(*A^*&%DFASF________ +<>?><?><?><>?>>?<>??><A?S>D<?A>S<D?><G?S><DG?S><G + +2.2339337309978227 +................. +lorem ipsum whatever + +through the darkness of future past +the magician longs to see +one [chants|chance] out between two worlds +fire, walk with me + + +(&!*^@$*&@!^*&@#^$*&@#$*&@#$^*&@^#$)(&)(!&$(*&^@&#*$ + +MOAR testing09237861235980723894570389yfskdjhgfm13jo847rtnjcsjjdhfgnc12o387456vb1p98364vlaisutfvlKUYASDOV*&Q@$%VOUAYFROVLUKSYDFP(*A^*&%DFASF________ +<>?><?><?><>?>>?<>??><A?S>D<?A>S<D?><G?S><DG?S><G + +INPUT +h e r e +*will* +d0 +0.753538467597066 +2.2339337309978227 +................. +lorem ipsum whatever + +through the darkness of future past +the magician longs to see +one [chants|chance] out between two worlds +fire, walk with me + + +h e r e +*will* +d0 +0.753538467597066 +2.2339337309978227 +................. +lorem ipsum whatever + +through the darkness of future past +the magician longs to see +one [chants|chance] out between two worlds +fire, walk with me + + +(&!*^@$*&@!^*&@#^$*&@#$*&@#$^*&@^#$)(&)(!&$(*&^@&#*$ + +MOAR testing09237861235980723894570389yfskdjhgfm13jo847rtnjcsjjdhfgnc12o387456vb1p98364vlaisutfvlKUYASDOV*&Q@$%VOUAYFROVLUKSYDFP(*A^*&%DFASF________ +<>?><?><?><>?>>?<>??><A?S>D<?A>S<D?><G?S><DG?S><G + +2.2339337309978227 +................. +lorem ipsum whatever + +through the darkness of future past +the magician longs to see +one [chants|chance] out between two worlds +fire, walk with me + + +(&!*^@$*&@!^*&@#^$*&@#$*&@#$^*&@^#$)(&)(!&$(*&^@&#*$ + +) # this isn't really needed either |