diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-01 18:50:26 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-01 18:50:26 -0800 |
commit | 2740fa0342c11481e3dad18c775a1aa0b862e8d8 (patch) | |
tree | 102bc902cde06a00f9de2e75adde1dc2f68e7b50 /test/float_ops.cpp | |
parent | e4734d90b261d47b7fbf17996b59564a0df4e706 (diff) | |
download | binaryen-2740fa0342c11481e3dad18c775a1aa0b862e8d8.tar.gz binaryen-2740fa0342c11481e3dad18c775a1aa0b862e8d8.tar.bz2 binaryen-2740fa0342c11481e3dad18c775a1aa0b862e8d8.zip |
test conversions
Diffstat (limited to 'test/float_ops.cpp')
-rw-r--r-- | test/float_ops.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/float_ops.cpp b/test/float_ops.cpp index ae1c913de..ddd8bcae6 100644 --- a/test/float_ops.cpp +++ b/test/float_ops.cpp @@ -25,5 +25,21 @@ int EMSCRIPTEN_KEEPALIVE dle(double x, double y) { return x <= y; } int EMSCRIPTEN_KEEPALIVE dgt(double x, double y) { return x > y; } int EMSCRIPTEN_KEEPALIVE dge(double x, double y) { return x >= y; } +double EMSCRIPTEN_KEEPALIVE int_to_double(int x) { + double d = x; + return d + 1.23; +} + +double EMSCRIPTEN_KEEPALIVE uint_to_double(unsigned x) { + double d = x; + return d + 1.23; +} + +int EMSCRIPTEN_KEEPALIVE double_to_int(double d) { + d += 1.23; + int x = d; + return x; +} + } |