summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhunt <hunt>2005-09-09 09:34:37 +0000
committerhunt <hunt>2005-09-09 09:34:37 +0000
commitc99fd5e6fbaebd0a414086d8a72c3b5e0bc9cc9c (patch)
tree578eb862212d13bf73484b15ea6499a41f52ee40
parent22c6c6b2b42f375d9e259e091015b768314efdaa (diff)
downloadsystemtap-steved-c99fd5e6fbaebd0a414086d8a72c3b5e0bc9cc9c.tar.gz
systemtap-steved-c99fd5e6fbaebd0a414086d8a72c3b5e0bc9cc9c.tar.xz
systemtap-steved-c99fd5e6fbaebd0a414086d8a72c3b5e0bc9cc9c.zip
2005-09-09 Martin Hunt <hunt@redhat.com>
* math/div64.c (main): Fixes for running on 64-bit hardware.
-rw-r--r--runtime/tests/ChangeLog2
-rw-r--r--runtime/tests/math/div64.c13
2 files changed, 14 insertions, 1 deletions
diff --git a/runtime/tests/ChangeLog b/runtime/tests/ChangeLog
index 709a1906..d1fa7ea1 100644
--- a/runtime/tests/ChangeLog
+++ b/runtime/tests/ChangeLog
@@ -1,5 +1,7 @@
2005-09-09 Martin Hunt <hunt@redhat.com>
+ * math/div64.c (main): Fixes for running on 64-bit hardware.
+
* README: Update.
* math/div64.c: New file. 64-bit division tests.
diff --git a/runtime/tests/math/div64.c b/runtime/tests/math/div64.c
index ce637a92..61f4e843 100644
--- a/runtime/tests/math/div64.c
+++ b/runtime/tests/math/div64.c
@@ -80,6 +80,7 @@ int main()
if (y == 0)
continue;
+#ifndef __LP64__
for (x = LONG_MIN - 1LL; x < LONG_MIN + 2LL; x++ ) {
div1 = _stp_div64(&error, x, y);
mod1 = _stp_mod64(&error, x, y);
@@ -109,10 +110,20 @@ int main()
exit (-1);
}
}
+#endif
for (x = LLONG_MIN; x <= LLONG_MIN + 1LL; x++ ) {
div1 = _stp_div64(&error, x, y);
mod1 = _stp_mod64(&error, x, y);
+#ifdef __LP64__
+ if (x == LLONG_MIN && y == -1) {
+ if (div1 != 0) {
+ printf ("%lld/%lld was %lld and should have been 0 (overflow)\n", x,y,div1);
+ exit(-1);
+ }
+ continue;
+ }
+#endif
div2 = x/y;
mod2 = x%y;
if (div1 != div2) {
@@ -125,7 +136,7 @@ int main()
}
}
- for (x = LONG_MAX - 1; x <= LONG_MAX; x++ ) {
+ for (x = LONG_MAX - 1; x > 0 && x <= LONG_MAX; x++ ) {
div1 = _stp_div64(&error, x, y);
mod1 = _stp_mod64(&error, x, y);
div2 = x/y;