diff options
author | Alon Zakai <azakai@google.com> | 2020-07-21 09:15:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-21 09:15:27 -0700 |
commit | 71c9572e8bdcf05306e6df1fb3bd1afc924d2f83 (patch) | |
tree | 2e29b9b952b2eced617f26d315ec5683821300dc /test | |
parent | 8da3c515bd13b3621047849548b7dc0c5586ec89 (diff) | |
download | binaryen-71c9572e8bdcf05306e6df1fb3bd1afc924d2f83.tar.gz binaryen-71c9572e8bdcf05306e6df1fb3bd1afc924d2f83.tar.bz2 binaryen-71c9572e8bdcf05306e6df1fb3bd1afc924d2f83.zip |
Fix i32.trunc_f64_s of values near the limit of f64 representation (#2968)
See WebAssembly/spec#1223
Diffstat (limited to 'test')
-rw-r--r-- | test/spec/conversions.wast | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/spec/conversions.wast b/test/spec/conversions.wast index c0ae54a53..2b3e30498 100644 --- a/test/spec/conversions.wast +++ b/test/spec/conversions.wast @@ -67,6 +67,8 @@ (assert_return (invoke "i32.trunc_f32_s" (f32.const -2.0)) (i32.const -2)) (assert_return (invoke "i32.trunc_f32_s" (f32.const 2147483520.0)) (i32.const 2147483520)) (assert_return (invoke "i32.trunc_f32_s" (f32.const -2147483648.0)) (i32.const -2147483648)) +(assert_return (invoke "i32.trunc_f64_s" (f64.const 2147483647.9999998)) (i32.const 2147483647)) +(assert_trap (invoke "i32.trunc_f64_s" (f64.const 2147483647.9999999)) "integer overflow") (assert_trap (invoke "i32.trunc_f32_s" (f32.const 2147483648.0)) "integer overflow") (assert_trap (invoke "i32.trunc_f32_s" (f32.const -2147483904.0)) "integer overflow") (assert_trap (invoke "i32.trunc_f32_s" (f32.const inf)) "integer overflow") |