-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #340 from wasmx/bench-exec
bench: Fix execution pre-validation
- Loading branch information
Showing
20 changed files
with
224 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Fizzy: A fast WebAssembly interpreter | ||
# Copyright 2020 The Fizzy Authors. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
add_subdirectory(benchmarks) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Fizzy: A fast WebAssembly interpreter | ||
# Copyright 2020 The Fizzy Authors. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
add_test( | ||
NAME fizzy/smoketests/bench/benchmarks | ||
COMMAND fizzy-bench ${CMAKE_CURRENT_LIST_DIR} --benchmark_min_time=0.01 | ||
) | ||
|
||
add_test( | ||
NAME fizzy/smoketests/bench/cli-missing-dir-arg | ||
COMMAND fizzy-bench | ||
) | ||
set_tests_properties( | ||
fizzy/smoketests/bench/cli-missing-dir-arg | ||
PROPERTIES | ||
PASS_REGULAR_EXPRESSION "Missing DIR argument" | ||
) | ||
|
||
add_test( | ||
NAME fizzy/smoketests/bench/cli-invalid-arg | ||
COMMAND fizzy-bench ${CMAKE_CURRENT_LIST_DIR} --nonexisting_argument | ||
) | ||
set_tests_properties( | ||
fizzy/smoketests/bench/cli-invalid-arg | ||
PROPERTIES | ||
PASS_REGULAR_EXPRESSION "error: unrecognized command-line flag: --nonexisting_argument" | ||
) | ||
|
||
|
||
# Dump coverage data to distinct files (otherwise file will be overwritten). | ||
set_tests_properties( | ||
fizzy/smoketests/bench/benchmarks | ||
fizzy/smoketests/bench/cli-missing-dir-arg | ||
fizzy/smoketests/bench/cli-invalid-arg | ||
PROPERTIES | ||
ENVIRONMENT LLVM_PROFILE_FILE=${CMAKE_BINARY_DIR}/bench-%p.profraw | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
addition | ||
add | ||
ii:i | ||
1 2 | ||
|
||
3 | ||
|
||
division_by_zero | ||
div | ||
ii:i | ||
1 0 | ||
|
||
0 | ||
|
||
memory_initialization_failure | ||
add | ||
ii:i | ||
0 0 | ||
fe | ||
0 | ||
|
||
unexcepted_result | ||
div | ||
ii:i | ||
1 1 | ||
|
||
|
||
|
||
expected_memory_shorter | ||
add | ||
ii:i | ||
0 0 | ||
|
||
0 | ||
00 | ||
|
||
missing_function | ||
sub | ||
ii:i | ||
0 0 | ||
|
||
0 | ||
|
||
incorrect_result_value | ||
add | ||
ii:i | ||
2 2 | ||
|
||
5 | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(module | ||
(func (export "add") (param i32 i32) (result i32) | ||
local.get 0 | ||
local.get 1 | ||
i32.add | ||
) | ||
(func (export "div") (param i32 i32) (result i32) | ||
local.get 0 | ||
local.get 1 | ||
i32.div_u | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
add | ||
add | ||
ii:i | ||
1 2 | ||
|
||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
(module | ||
(func (export "add") (param i32 i32) (result i32) | ||
local.get 0 | ||
i32.add | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
fake | ||
fake_func | ||
: | ||
|
||
|
||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
increase_value | ||
inc | ||
i: | ||
0 | ||
ff000000 | ||
|
||
00010000 | ||
|
||
|
||
wrong_expected_memory | ||
inc | ||
i: | ||
0 | ||
ff000000 | ||
|
||
ffffffff | ||
|
||
missing_result_value | ||
inc | ||
i: | ||
0 | ||
|
||
0 | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(module | ||
(memory 1 1) | ||
(func (export "inc") (param i32) | ||
local.get 0 | ||
local.get 0 | ||
i32.load | ||
i32.const 1 | ||
i32.add | ||
i32.store | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
main | ||
main | ||
i:i | ||
0 | ||
|
||
0 | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
(module | ||
(func $imported (import "env" "imported") (param i32) (result i32)) | ||
(func (export "main") (param i32) (result i32) | ||
local.get 0 | ||
call $imported | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters