summaryrefslogtreecommitdiff
path: root/test/parse/expr
diff options
context:
space:
mode:
Diffstat (limited to 'test/parse/expr')
-rw-r--r--test/parse/expr/callref-imported-function.txt11
-rw-r--r--test/parse/expr/callref-internal-function.txt14
2 files changed, 25 insertions, 0 deletions
diff --git a/test/parse/expr/callref-imported-function.txt b/test/parse/expr/callref-imported-function.txt
new file mode 100644
index 00000000..255f7c19
--- /dev/null
+++ b/test/parse/expr/callref-imported-function.txt
@@ -0,0 +1,11 @@
+;;; TOOL: wat2wasm
+;;; ARGS: --enable-function-references
+(module
+ (import "" "foo" (func $foo (param i32) (result i32)))
+ (func (export "main") (result i32)
+ (call_ref (i32.const 10)
+ (ref.func $foo)
+ )
+ )
+ (elem declare funcref (ref.func $foo))
+)
diff --git a/test/parse/expr/callref-internal-function.txt b/test/parse/expr/callref-internal-function.txt
new file mode 100644
index 00000000..5cc27cc6
--- /dev/null
+++ b/test/parse/expr/callref-internal-function.txt
@@ -0,0 +1,14 @@
+;;; TOOL: wat2wasm
+;;; ARGS: --enable-function-references
+(module
+ (func (export "main") (result i32)
+ (call_ref (i32.const 10)
+ (ref.func $foo)
+ )
+ )
+ (func $foo (param $x i32) (result i32)
+ (i32.add (local.get $x)
+ (i32.const 19))
+ )
+ (elem declare funcref (ref.func $foo))
+)