summaryrefslogtreecommitdiff
path: root/test/interp/run-export-with-argument.txt
diff options
context:
space:
mode:
authorRaphael Amorim <rapha850@gmail.com>2023-03-19 19:48:40 +0100
committerGitHub <noreply@github.com>2023-03-19 18:48:40 +0000
commitaef2cccd52103a71d669dbdfcd6f12bdb7375410 (patch)
treec3771cb756241a7cb249098ce86bcbfdffc94f08 /test/interp/run-export-with-argument.txt
parent090d4674c86b00e31d18e77f2c8f8570a68e1cf1 (diff)
downloadwabt-aef2cccd52103a71d669dbdfcd6f12bdb7375410.tar.gz
wabt-aef2cccd52103a71d669dbdfcd6f12bdb7375410.tar.bz2
wabt-aef2cccd52103a71d669dbdfcd6f12bdb7375410.zip
wasm-interp: Add --run-export and --argument (#2176)
Diffstat (limited to 'test/interp/run-export-with-argument.txt')
-rw-r--r--test/interp/run-export-with-argument.txt34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/interp/run-export-with-argument.txt b/test/interp/run-export-with-argument.txt
new file mode 100644
index 00000000..55bec662
--- /dev/null
+++ b/test/interp/run-export-with-argument.txt
@@ -0,0 +1,34 @@
+;;; TOOL: run-interp
+;;; ARGS1: --run-export=func_sum --argument=i64:8 --argument=i64:5 --run-export=func_fac --argument=i32:10
+(module
+ (func (export "func_sum") (param i64) (param i64) (result i64)
+ local.get 0
+ local.get 1
+ i64.add
+ return)
+
+ (func (export "func_fac") (param i32) (result i32)
+ local.get 0
+ call $fac)
+
+ (func $fac (param i32) (result i32)
+ local.get 0
+ i32.const 0
+ i32.gt_s
+ if (result i32)
+ local.get 0
+ local.get 0
+ i32.const 1
+ i32.sub
+ call $fac
+ i32.mul
+ return
+ else
+ i32.const 1
+ return
+ end)
+)
+(;; STDOUT ;;;
+func_sum(i64:8, i64:5) => i64:13
+func_fac(i32:10) => i32:3628800
+;;; STDOUT ;;)