summaryrefslogtreecommitdiff
path: root/test/typed-function-references.wast
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-11-25 15:36:04 -0800
committerGitHub <noreply@github.com>2020-11-25 15:36:04 -0800
commit3c66ad3c7c602416d4cf674b3d7528d9acd6d51f (patch)
treeecf2308d4cbc2c995c66fcc9375b7bab341d6ca0 /test/typed-function-references.wast
parent72c035e905b3695f2763fdeb21163003d8595887 (diff)
downloadbinaryen-3c66ad3c7c602416d4cf674b3d7528d9acd6d51f.tar.gz
binaryen-3c66ad3c7c602416d4cf674b3d7528d9acd6d51f.tar.bz2
binaryen-3c66ad3c7c602416d4cf674b3d7528d9acd6d51f.zip
[TypedFunctionReferences] Enable call_ref in fuzzer, and fix minor misc fuzz bugs (#3401)
* Count signatures in tuple locals. * Count nested signature types (confirming @aheejin was right, that was missing). * Inlining was using the wrong type. * OptimizeInstructions should return -1 for unhandled types, not error. * The fuzzer should check for ref types as well, not just typed function references, similar to what GC does. * The fuzzer now creates a function if it has no other option for creating a constant expression of a function type, then does a ref.func of that. * Handle unreachability in call_ref binary reading. * S-expression parsing fixes in more places, and add a tiny fuzzer for it. * Switch fuzzer test to just have the metrics, and not print all the fuzz output which changes a lot. Also fix noprint handling which only worked on binaries before. * Fix Properties::getLiteral() to use the specific function type properly, and make Literal's function constructor require that, to prevent future bugs. * Turn all input types into nullable types, for now.
Diffstat (limited to 'test/typed-function-references.wast')
-rw-r--r--test/typed-function-references.wast20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/typed-function-references.wast b/test/typed-function-references.wast
index 59346f615..47fd789d0 100644
--- a/test/typed-function-references.wast
+++ b/test/typed-function-references.wast
@@ -1,4 +1,7 @@
(module
+ ;; inline ref type in result
+ (type $f64_=>_ref_null<_->_eqref> (func (param f64) (result (ref null (func (result eqref))))))
+
(type $i32-i32 (func (param i32) (result i32)))
(func $call-ref
@@ -21,4 +24,21 @@
(local.set $f (ref.func $call-ref-more))
(call_ref (i32.const 42) (local.get $f))
)
+ (func $ref-in-sig (param $0 f64) (result (ref null (func (result eqref))))
+ ;; ref.null of an inline type
+ (ref.null (func (result eqref)))
+ )
+ (func $type-only-in-tuple-local
+ (local $x (i32 (ref null (func (result anyref))) f64))
+ )
+ (func $type-only-in-tuple-block
+ (drop
+ (block (result i32 (ref null (func (result anyref f32 anyref f32))) f64)
+ (unreachable)
+ )
+ )
+ )
+ (func $nested-type-only-there (result (ref (func (result (ref (func (param i32 i32 i32 i32 i32)))))))
+ (unreachable)
+ )
)