diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-03-05 21:55:36 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-03-05 21:55:36 -0800 |
commit | aeb905a51654cd46866d853e62322e2cb77b2425 (patch) | |
tree | 756747fb6665739b325e6c670510f232c891f19b /tests | |
parent | a9c1100839bd70225a9d0a7e127797356ce180c4 (diff) |
handle signedness properly in 64-bit div, mul, rem
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 11fe7677..e8bcb72e 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -776,6 +776,30 @@ m_divisor is 1091269979 ''' self.do_run(src, '*0,0,0,0*\n*1,1,0,0*\n') # same as gcc + def test_i64_umul(self): + if Settings.USE_TYPED_ARRAYS != 2: return self.skip('full i64 stuff only in ta2') + src = r''' + #include <inttypes.h> + #include <stdio.h> + + typedef uint32_t UINT32; + typedef uint64_t UINT64; + + int main() { + volatile UINT32 testu32a = 2375724032U; + UINT32 bigu32 = 0xffffffffU; + volatile UINT64 testu64a = 14746250828952703000U; + + while ((UINT64)testu32a * (UINT64)bigu32 < testu64a) { + printf("testu64a is %llu\n", testu64a); + testu64a /= 2; + } + + return 0; + } + ''' + self.do_run(src, 'testu64a is 14746250828952703000\n') + def test_unaligned(self): if Settings.QUANTUM_SIZE == 1: return self.skip('No meaning to unaligned addresses in q1') |