aboutsummaryrefslogtreecommitdiff
path: root/tests/wasm_compile_function_call/instructions.wat
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wasm_compile_function_call/instructions.wat')
-rw-r--r--tests/wasm_compile_function_call/instructions.wat13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/wasm_compile_function_call/instructions.wat b/tests/wasm_compile_function_call/instructions.wat
new file mode 100644
index 0000000..ad37037
--- /dev/null
+++ b/tests/wasm_compile_function_call/instructions.wat
@@ -0,0 +1,13 @@
+(module
+ (memory 0 2)
+ (func $main
+ i32.const 0x17 ;; dynamic offset for memory store instruction
+ i32.const 0x32 ;; value to substract from
+ i32.const 0x14 ;; value to substract
+ call $sub
+ i32.store offset=0x25 align=2) ;; we store the difference at 0x23C
+ (func $sub (param $lhs i32) (param $rhs i32) (result i32)
+ local.get $lhs
+ local.get $rhs
+ i32.sub)
+ (export "main" (func $main)))