summaryrefslogtreecommitdiff
path: root/test/unit.fromasm.no-opts
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit.fromasm.no-opts')
-rw-r--r--test/unit.fromasm.no-opts38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/unit.fromasm.no-opts b/test/unit.fromasm.no-opts
index 021ce41f9..eda573fbd 100644
--- a/test/unit.fromasm.no-opts
+++ b/test/unit.fromasm.no-opts
@@ -43,6 +43,7 @@
(export "frem" (func $frem))
(export "frem_float" (func $legalstub$frem_float))
(export "big_uint_div_u" (func $big_uint_div_u))
+ (export "trapping_sint_div_s" (func $trapping_sint_div_s))
(export "fr" (func $legalstub$fr))
(export "negZero" (func $negZero))
(export "neg" (func $neg))
@@ -429,6 +430,43 @@
(get_local $x)
)
)
+ (func $i32s-div (param $0 i32) (param $1 i32) (result i32)
+ (if (result i32)
+ (i32.eqz
+ (get_local $1)
+ )
+ (i32.const 0)
+ (if (result i32)
+ (i32.and
+ (i32.eq
+ (get_local $0)
+ (i32.const -2147483648)
+ )
+ (i32.eq
+ (get_local $1)
+ (i32.const -1)
+ )
+ )
+ (i32.const 0)
+ (i32.div_s
+ (get_local $0)
+ (get_local $1)
+ )
+ )
+ )
+ )
+ (func $trapping_sint_div_s (result i32)
+ (local $x i32)
+ (set_local $x
+ (call $i32s-div
+ (i32.const -2147483648)
+ (i32.const -1)
+ )
+ )
+ (return
+ (get_local $x)
+ )
+ )
(func $fr (param $x f32)
(local $y f32)
(local $z f64)