diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-11-16 11:13:08 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-11-16 11:26:55 -0800 |
commit | 76071e42f3dcb22fec93c0ea963710988b566df0 (patch) | |
tree | f8a22498d9ea0aef9bdae9dfa43a485b8f705909 /tests/runner.py | |
parent | 9953de1d753ccf77494b42b0c19577413e5de6a1 (diff) |
print out hexadecimal 64-bit values properly, and fix some bugs with I64_PRECISE mode 2; fixes #716
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py index f454d098..de964809 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -996,12 +996,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, 'i64 precise math should not have been included if not actually used' - # But if we force it to be included, it is + # But if we force it to be included, it is. First, a case where we don't need it Settings.PRECISE_I64_MATH = 2 self.do_run(open(path_from_root('tests', 'hello_world.c')).read(), 'hello') code = open(os.path.join(self.get_dir(), 'src.cpp.o.js')).read() assert 'goog.math.Long' in code, 'i64 precise math should be included if forced' + # and now one where we do + self.do_run(r''' + #include <stdio.h> + + int main( int argc, char ** argv ) + { + unsigned long a = 0x60DD1695U; + unsigned long b = 0xCA8C4E7BU; + unsigned long long c = (unsigned long long)a * b; + printf( "c = %016llx\n", c ); + + return 0; + } + ''', 'c = 4ca38a6bd2973f97') + def test_i64_zextneg(self): if Settings.USE_TYPED_ARRAYS != 2: return self.skip('full i64 stuff only in ta2') |