From ca4e5c1cca9f0e6db5f564e6786a356bcdffb956 Mon Sep 17 00:00:00 2001 From: Wojciech Kosior Date: Mon, 21 Sep 2020 11:53:13 +0200 Subject: put function call wasm_compile test in separate bench --- tests/wasm_compile_function_call/Makefile | 1 + tests/wasm_compile_function_call/instructions.wat | 13 +++++++++++++ tests/wasm_compile_function_call/test.v | 1 + tests/wasm_compile_function_call/words_to_verify.mem | 3 +++ tests/wasm_compile_simple_module/instructions.wat | 12 +++++------- tests/wasm_compile_simple_module/words_to_verify.mem | 2 +- 6 files changed, 24 insertions(+), 8 deletions(-) create mode 120000 tests/wasm_compile_function_call/Makefile create mode 100644 tests/wasm_compile_function_call/instructions.wat create mode 120000 tests/wasm_compile_function_call/test.v create mode 100644 tests/wasm_compile_function_call/words_to_verify.mem (limited to 'tests') diff --git a/tests/wasm_compile_function_call/Makefile b/tests/wasm_compile_function_call/Makefile new file mode 120000 index 0000000..e451c8b --- /dev/null +++ b/tests/wasm_compile_function_call/Makefile @@ -0,0 +1 @@ +../wasm_compile_simple_module/Makefile \ No newline at end of file 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))) diff --git a/tests/wasm_compile_function_call/test.v b/tests/wasm_compile_function_call/test.v new file mode 120000 index 0000000..f0235d8 --- /dev/null +++ b/tests/wasm_compile_function_call/test.v @@ -0,0 +1 @@ +../wasm_compile_simple_module/test.v \ No newline at end of file diff --git a/tests/wasm_compile_function_call/words_to_verify.mem b/tests/wasm_compile_function_call/words_to_verify.mem new file mode 100644 index 0000000..bd24e95 --- /dev/null +++ b/tests/wasm_compile_function_call/words_to_verify.mem @@ -0,0 +1,3 @@ +// address value + 0FFFFC 23 + 23C 1E // Address is 0x200 + 0x25 + 0x17 diff --git a/tests/wasm_compile_simple_module/instructions.wat b/tests/wasm_compile_simple_module/instructions.wat index 7579a46..bdf8a16 100644 --- a/tests/wasm_compile_simple_module/instructions.wat +++ b/tests/wasm_compile_simple_module/instructions.wat @@ -1,9 +1,7 @@ (module (memory 0 2) - (func $sub (param $lhs i32) (param $rhs i32);; (result i32) - i32.const 0x17 - local.get $lhs - local.get $rhs - i32.sub - i32.store offset=0x25 align=2) - (export "main" (func $sub))) + (func $main + i32.const 0x1D ;; dynamic offset for memory store instruction + i32.const 0x1E ;; value to store + i32.store offset=0x1F align=2) ;; we store the difference at 0x23C + (export "main" (func $main))) diff --git a/tests/wasm_compile_simple_module/words_to_verify.mem b/tests/wasm_compile_simple_module/words_to_verify.mem index bd24e95..d6a16c1 100644 --- a/tests/wasm_compile_simple_module/words_to_verify.mem +++ b/tests/wasm_compile_simple_module/words_to_verify.mem @@ -1,3 +1,3 @@ // address value 0FFFFC 23 - 23C 1E // Address is 0x200 + 0x25 + 0x17 + 23C 1E // Address is 0x200 + 0x1F + 0x1D -- cgit v1.2.3