Skip to content

Commit

Permalink
Merge pull request #3035 from wasmerio/divide_zero_wast_test
Browse files Browse the repository at this point in the history
Added a simple divide by zero trap wast test (for #1899)
  • Loading branch information
syrusakbary authored Jul 22, 2022
2 parents 30a2083 + fd3856f commit 7a7271e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/wast/wasmer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ by the standard WebAssembly spectests.
## NaN canonicalization: `nan-canonicalization.wast`

This is an extra set of tests that assure that operations with NaNs
are deterministic regarless of the environment/chipset where it executes in.
are deterministic regardless of the environment/chipset where it executes in.

## Call Indirect Spilled Stack: `call-indirect-spilledd-stack.wast`

Expand All @@ -28,3 +28,7 @@ This is a simple factorial program.

Stack space for a structure returning function call should be allocated once up
front, not once in each call.

## Divide by Zero: `divide.wast`

This is a simple test to check that a divide by zero is correctly trapped
4 changes: 4 additions & 0 deletions tests/wast/wasmer/divide.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(module
(func (export "div_s") (param $x i64) (param $y i64) (result i64) (i64.div_s (local.get $x) (local.get $y)))
)
(assert_trap (invoke "div_s" (i64.const 1) (i64.const 0)) "integer divide by zero")

0 comments on commit 7a7271e

Please sign in to comment.