Add unit test suites (#3490)
This commit is contained in:
27
tests/unit/aot-stack-frame/wasm-apps/CMakeLists.txt
Normal file
27
tests/unit/aot-stack-frame/wasm-apps/CMakeLists.txt
Normal file
@ -0,0 +1,27 @@
|
||||
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
cmake_minimum_required(VERSION 2.9)
|
||||
|
||||
project(wasm-apps-aot-stack-frame)
|
||||
|
||||
add_custom_target(aot-stack-frame-test-wasm ALL
|
||||
COMMAND cmake -B ${CMAKE_CURRENT_BINARY_DIR}/build-wamrc
|
||||
-S ${WAMR_ROOT_DIR}/wamr-compiler
|
||||
&& cmake --build ${CMAKE_CURRENT_BINARY_DIR}/build-wamrc
|
||||
&& /opt/wabt/bin/wat2wasm
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/test.wasm
|
||||
${CMAKE_CURRENT_LIST_DIR}/test.wast
|
||||
&& ${CMAKE_CURRENT_BINARY_DIR}/build-wamrc/wamrc
|
||||
--enable-dump-call-stack --bounds-checks=1
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/test.aot
|
||||
${CMAKE_CURRENT_BINARY_DIR}/test.wasm
|
||||
&& cmake -B ${CMAKE_CURRENT_BINARY_DIR}/build-binarydump
|
||||
-S ${WAMR_ROOT_DIR}/test-tools/binarydump-tool
|
||||
&& cmake --build ${CMAKE_CURRENT_BINARY_DIR}/build-binarydump
|
||||
&& ${CMAKE_CURRENT_BINARY_DIR}/build-binarydump/binarydump
|
||||
-o ${CMAKE_CURRENT_LIST_DIR}/test_aot.h -n test_aot
|
||||
${CMAKE_CURRENT_BINARY_DIR}/test.aot
|
||||
|
||||
)
|
||||
|
||||
36
tests/unit/aot-stack-frame/wasm-apps/test.wast
Normal file
36
tests/unit/aot-stack-frame/wasm-apps/test.wast
Normal file
@ -0,0 +1,36 @@
|
||||
(module
|
||||
(func $test1 (export "test1") (param i32 i32) (result i32)
|
||||
i32.const 0x11223344
|
||||
i64.const 0x1234_5678_ABCD_EF99
|
||||
f32.const 5566.7788
|
||||
f64.const 99887766.55443322
|
||||
unreachable
|
||||
)
|
||||
|
||||
(func $test2 (export "test2") (param f32 f32) (result i32)
|
||||
i32.const 0x11223344
|
||||
i64.const 0x1234_5678_ABCD_EF99
|
||||
f32.const 5566.7788
|
||||
f64.const 99887766.55443322
|
||||
|
||||
loop
|
||||
i32.const 0x1234
|
||||
i32.const 0x5678
|
||||
unreachable
|
||||
end
|
||||
|
||||
unreachable
|
||||
)
|
||||
|
||||
(func $test3 (export "test3") (param i32 i32) (result i32)
|
||||
i32.const 0x11223344
|
||||
i64.const 0x1234_5678_ABCD_EF99
|
||||
|
||||
i32.const 0x1234
|
||||
i32.const 0x5678
|
||||
call $test1
|
||||
|
||||
drop
|
||||
drop
|
||||
)
|
||||
)
|
||||
Reference in New Issue
Block a user