diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/calls.wat | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/calls.wat')
-rw-r--r-- | third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/calls.wat | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/calls.wat b/third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/calls.wat new file mode 100644 index 0000000000..6fba4c4e6e --- /dev/null +++ b/third_party/rust/lucet-runtime-wasmsbx/tests/instruction_counting/calls.wat @@ -0,0 +1,22 @@ +(module + (func $mul2 (param $in i64) (result i64) + get_local $in + get_local $in + i64.mul + ) + (func $main (export "test_function") + i64.const 1 + call $mul2 ;; one from the call, three from the called function, one for the return + drop + i64.const 2 + call $mul2 ;; and again + drop + i64.const 3 + call $mul2 ;; and again + ;; for a total of 3 * 6 == 18 instructions + drop + ) + (func $instruction_count (export "instruction_count") (result i64) + i64.const 18 + ) +) |