diff options
author | Ben Smith <binji@chromium.org> | 2016-04-01 12:30:07 -0700 |
---|---|---|
committer | Ben Smith <binji@chromium.org> | 2016-04-02 22:32:14 -0700 |
commit | 3218cc8b453c361936fe69fe9a0ec530d47db79c (patch) | |
tree | 9b04fbe4c6eeaede3bbb21c041444b4b4095f9a2 /test/interp/cast.txt | |
parent | 78526e008053b01b5a65cce53e916533e44aad39 (diff) | |
download | wabt-3218cc8b453c361936fe69fe9a0ec530d47db79c.tar.gz wabt-3218cc8b453c361936fe69fe9a0ec530d47db79c.tar.bz2 wabt-3218cc8b453c361936fe69fe9a0ec530d47db79c.zip |
add interpreter tests, copied from d8 tests
Diffstat (limited to 'test/interp/cast.txt')
-rw-r--r-- | test/interp/cast.txt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/interp/cast.txt b/test/interp/cast.txt new file mode 100644 index 00000000..c60ac811 --- /dev/null +++ b/test/interp/cast.txt @@ -0,0 +1,28 @@ +;;; TOOL: run-interp +(module + (export "f32_reinterpret_i32" $f32_reinterpret_i32) + (func $f32_reinterpret_i32 (result f32) + (f32.reinterpret/i32 (i32.const 0x40900000))) + + (export "i32_reinterpret_f32" $i32_reinterpret_f32) + (func $i32_reinterpret_f32 (result i32) + (i32.reinterpret/f32 (f32.const -3.5))) + + (export "f64_reinterpret_i64" $f64_reinterpret_i64) + (func $f64_reinterpret_i64 (result f64) + (f64.reinterpret/i64 (i64.const 0x405f480000000000))) + + ;; The JavaScript host truncates if you try to return an i64, so we'll do a + ;; comparison against the expected value instead. + (export "i64_reinterpret_f64" $i64_reinterpret_f64) + (func $i64_reinterpret_f64 (result i32) + (i64.eq + (i64.reinterpret/f64 (f64.const 1.375e10)) + (i64.const 0x42099c82cc000000))) +) +(;; STDOUT ;;; +f32_reinterpret_i32() => f32:4.5 +i32_reinterpret_f32() => i32:3227516928 +f64_reinterpret_i64() => f64:125.125 +i64_reinterpret_f64() => i32:1 +;;; STDOUT ;;) |