aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-09-13 21:40:00 +0000
committerJason Molenda <jmolenda@apple.com>1999-09-13 21:40:00 +0000
commitcff3e48be70e018476521d0f62705c29f4112771 (patch)
tree09899684e1ac06491418cb186525498ba0a60544 /gdb/testsuite
parent59f2c4e703f7c5f894322210c24e0ffc4c1c56eb (diff)
downloadgdb-cff3e48be70e018476521d0f62705c29f4112771.zip
gdb-cff3e48be70e018476521d0f62705c29f4112771.tar.gz
gdb-cff3e48be70e018476521d0f62705c29f4112771.tar.bz2
import gdb-1999-09-13 snapshot
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/long_long.exp66
2 files changed, 62 insertions, 9 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 15dd281..7198d6e 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+1999-09-09 Stan Shebs <shebs@andros.cygnus.com>
+
+ * long_long.exp: Add variations of test cases that work for
+ targets with 16-bit ints and 32-bit doubles.
+
1999-09-08 Stan Shebs <shebs@andros.cygnus.com>
* break.c (main): Compare a possibly-uninitialized argc with an
diff --git a/gdb/testsuite/gdb.base/long_long.exp b/gdb/testsuite/gdb.base/long_long.exp
index b779434..651daff 100644
--- a/gdb/testsuite/gdb.base/long_long.exp
+++ b/gdb/testsuite/gdb.base/long_long.exp
@@ -69,6 +69,28 @@ gdb_expect {
default { fail "(timeout) getting target endian" }
}
+# Detect targets with 2-byte integers. Yes, it's not general to assume
+# that all others have 4-byte ints, but don't worry about it until one
+# actually exists.
+
+set sizeof_int 4
+send_gdb "print sizeof(int)\n"
+gdb_expect {
+ -re ".* = 2.*$gdb_prompt $" { set sizeof_int 2 }
+ -re ".*$gdb_prompt $" { }
+ default { }
+}
+
+# Detect targets with 4-byte doubles.
+
+set sizeof_double 8
+send_gdb "print sizeof(double)\n"
+gdb_expect {
+ -re ".* = 4.*$gdb_prompt $" { set sizeof_double 4 }
+ -re ".*$gdb_prompt $" { }
+ default { }
+}
+
gdb_test "n 4" ".*38.*" "get to known place"
# Check the hack for long long prints.
@@ -96,17 +118,39 @@ gdb_test "p/o oct" ".*.*"
gdb_test "p/t oct" ".*1010011100101110111001010011100101110111000001010011100101110111.*"
gdb_test "p/a oct" ".*0x.*77053977.*"
gdb_test "p/c oct" ".*'w'.*"
-gdb_test "p/f oct" ".*-5.9822653797615723e-120.*"
+
+if { $sizeof_double == 8 } {
+
+ gdb_test "p/f oct" ".*-5.9822653797615723e-120.*"
+
+} else {
+
+ gdb_test "p/f oct" ".*-2.42716126e-15.*"
+}
if { $target_bigendian_p } {
- gdb_test "p/d *(int *)&oct" ".*-1490098887.*"
- gdb_test "p/u *(int *)&oct" ".*2804868409.*"
- gdb_test "p/o *(int *)&oct" ".*024713562471.*"
- gdb_test "p/t *(int *)&oct" ".*10100111001011101110010100111001.*"
- gdb_test "p/a *(int *)&oct" ".*0xf*a72ee539.*"
- gdb_test "p/c *(int *)&oct" ".*57 '9'.*"
- gdb_test "p/f *(int *)&oct" ".*-2.42716126e-15.*"
+ if { $sizeof_int == 4 } {
+
+ gdb_test "p/d *(int *)&oct" ".*-1490098887.*"
+ gdb_test "p/u *(int *)&oct" ".*2804868409.*"
+ gdb_test "p/o *(int *)&oct" ".*024713562471.*"
+ gdb_test "p/t *(int *)&oct" ".*10100111001011101110010100111001.*"
+ gdb_test "p/a *(int *)&oct" ".*0xf*a72ee539.*"
+ gdb_test "p/c *(int *)&oct" ".*57 '9'.*"
+ gdb_test "p/f *(int *)&oct" ".*-2.42716126e-15.*"
+
+ } else {
+
+ gdb_test "p/d *(int *)&oct" ".*-22738.*"
+ gdb_test "p/u *(int *)&oct" ".*42798.*"
+ gdb_test "p/o *(int *)&oct" ".*0123456.*"
+ gdb_test "p/t *(int *)&oct" ".*1010011100101110.*"
+ gdb_test "p/a *(int *)&oct" ".*0xffffa72e.*"
+ gdb_test "p/c *(int *)&oct" ".*46 '.'.*"
+ gdb_test "p/f *(int *)&oct" ".*-22738.*"
+
+ }
gdb_test "p/d *(short *)&oct" ".*-22738.*"
gdb_test "p/u *(short *)&oct" ".*42798.*"
@@ -126,7 +170,11 @@ if { $target_bigendian_p } {
gdb_test "x/c &oct" ".*-89 .*"
# FIXME GDB's output is correct, but this longer match fails.
# gdb_test "x/c &oct" ".*-89 '\\\\247'.*"
- gdb_test "x/f &oct" ".*-5.9822653797615723e-120.*"
+ if { $sizeof_double == 8 } {
+ gdb_test "x/f &oct" ".*-5.9822653797615723e-120.*"
+ } else {
+ gdb_test "x/f &oct" ".*-2.42716126e-15.*"
+ }
# FIXME Fill in the results for all the following tests. (But be careful
# about looking at locations with unspecified contents!)