aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-19 11:06:23 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-19 11:06:23 -0700
commita00c76524c3e4ffc12eb309459b74c50a3da3ad7 (patch)
tree0c6122cd073bd0582de41c57b4f98d9a84afe16e /tests
parent8cbede32db41ef73f648936109b00df01d9c23bb (diff)
zext sign correction for bitcasting from <32 bits to i64
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runner.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index cfb0832c..ecda863e 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -909,6 +909,27 @@ m_divisor is 1091269979
code = open(os.path.join(self.get_dir(), 'src.cpp.o.js')).read()
assert 'goog.math.Long' not in code and 'jsbn' not in code, 'i64 precise math should not have been included if not actually used'
+ def test_i64_zextneg(self):
+ if Settings.USE_TYPED_ARRAYS != 2: return self.skip('full i64 stuff only in ta2')
+
+ src = r'''
+ #include <stdint.h>
+ #include <stdio.h>
+
+ int main(int argc, char *argv[])
+ {
+ uint8_t byte = 0x80;
+ uint16_t two = byte;
+ uint32_t four = byte;
+ uint64_t eight = byte;
+
+ printf("value: %d,%d,%d,%lld.\n", byte, two, four, eight);
+
+ return 0;
+ }
+ '''
+ self.do_run(src, 'value: 128,128,128,128.')
+
def test_cube2hash(self):
# A good test of i64 math
if Settings.USE_TYPED_ARRAYS != 2: return self.skip('requires ta2 C-style memory aliasing')