Skip to content

Commit

Permalink
Incorporate the remaining tests from unsigned.wasm into conversions.w…
Browse files Browse the repository at this point in the history
…asm.
  • Loading branch information
sunfishcode committed Sep 25, 2015
1 parent 77c896c commit 52e8564
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 29 deletions.
10 changes: 9 additions & 1 deletion ml-proto/test/conversions.wasm
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,12 @@
(assert_eq (invoke "i32.trunc_u_f64" (f64.const 2147483648)) (i32.const -2147483648)) ;; 0x1.00000p+31 -> 8000 0000
(assert_eq (invoke "i32.trunc_u_f64" (f64.const 4294967295.0)) (i32.const -1))
(assert_eq (invoke "i32.trunc_u_f64" (f64.const -0.9)) (i32.const 0))
(assert_eq (invoke "i32.trunc_u_f64" (f64.const 1e8)) (i32.const 100000000))
(assert_trap (invoke "i32.trunc_u_f64" (f64.const 4294967296.0)) "runtime: integer overflow")
(assert_trap (invoke "i32.trunc_u_f64" (f64.const -1.0)) "runtime: integer overflow")
(assert_trap (invoke "i32.trunc_u_f64" (f64.const 1e16)) "runtime: integer overflow")
(assert_trap (invoke "i32.trunc_u_f64" (f64.const 1e30)) "runtime: integer overflow")
(assert_trap (invoke "i32.trunc_u_f64" (f64.const 9223372036854775808)) "runtime: integer overflow")

(assert_eq (invoke "i64.trunc_s_f32" (f32.const 1.0)) (i64.const 1))
(assert_eq (invoke "i64.trunc_s_f32" (f32.const 1.1)) (i64.const 1))
Expand Down Expand Up @@ -192,9 +196,13 @@
(assert_eq (invoke "i64.trunc_u_f64" (f64.const 1.0)) (i64.const 1))
(assert_eq (invoke "i64.trunc_u_f64" (f64.const 1.1)) (i64.const 1))
(assert_eq (invoke "i64.trunc_u_f64" (f64.const 1.5)) (i64.const 1))
(assert_eq (invoke "i64.trunc_u_f64" (f64.const 4294967296)) (i64.const 4294967296))
(assert_eq (invoke "i64.trunc_u_f64" (f64.const 4294967295)) (i64.const 0xffffffff))
(assert_eq (invoke "i64.trunc_u_f64" (f64.const 4294967296)) (i64.const 0x100000000))
(assert_eq (invoke "i64.trunc_u_f64" (f64.const 18446744073709549568.0)) (i64.const -2048))
(assert_eq (invoke "i64.trunc_u_f64" (f64.const -0.9)) (i64.const 0))
(assert_eq (invoke "i64.trunc_u_f64" (f64.const 1e8)) (i64.const 100000000))
(assert_eq (invoke "i64.trunc_u_f64" (f64.const 1e16)) (i64.const 10000000000000000))
(assert_eq (invoke "i64.trunc_u_f64" (f64.const 9223372036854775808)) (i64.const -9223372036854775808))
(assert_trap (invoke "i64.trunc_u_f64" (f64.const 18446744073709551616.0)) "runtime: integer overflow")
(assert_trap (invoke "i64.trunc_u_f64" (f64.const -1.0)) "runtime: integer overflow")

Expand Down
28 changes: 0 additions & 28 deletions ml-proto/test/unsigned.wasm

This file was deleted.

0 comments on commit 52e8564

Please sign in to comment.