aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-11-10 10:06:08 -0700
committerTom Tromey <tromey@adacore.com>2020-11-10 10:06:08 -0700
commit95016fd211b66445cb3b9e86aeb8b6951f56315f (patch)
tree85a0b870706fb76f3667b97e2c076f1e20e9dea0 /gdb
parent83100a74a542bc2fa99387f518712ec0ef408a4b (diff)
downloadgdb-95016fd211b66445cb3b9e86aeb8b6951f56315f.zip
gdb-95016fd211b66445cb3b9e86aeb8b6951f56315f.tar.gz
gdb-95016fd211b66445cb3b9e86aeb8b6951f56315f.tar.bz2
Fix bug in gdb.ada/bias.exp
While working on a different bug in the Ada support, I found that the gdb.ada/bias.exp test is slightly incorrect. In particular, it is using a range type, which it then overflows during an operation. This patch changes the test so that the computed values remain in range. gdb/testsuite/ChangeLog 2020-11-10 Tom Tromey <tromey@adacore.com> * gdb.ada/bias.exp: Update. * gdb.ada/bias/bias.adb (X): Change value.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.ada/bias.exp10
-rw-r--r--gdb/testsuite/gdb.ada/bias/bias.adb2
3 files changed, 11 insertions, 6 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 608e48d..18c3988 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-11-10 Tom Tromey <tromey@adacore.com>
+
+ * gdb.ada/bias.exp: Update.
+ * gdb.ada/bias/bias.adb (X): Change value.
+
2020-11-10 Gary Benson <gbenson@redhat.com>
* gdb.base/vla-optimized-out.exp (p sizeof (a)): Wrap supplied
diff --git a/gdb/testsuite/gdb.ada/bias.exp b/gdb/testsuite/gdb.ada/bias.exp
index c7a7850..dfa897f 100644
--- a/gdb/testsuite/gdb.ada/bias.exp
+++ b/gdb/testsuite/gdb.ada/bias.exp
@@ -29,7 +29,7 @@ clean_restart ${testfile}
set bp_location [gdb_get_line_number "STOP" ${testdir}/bias.adb]
runto "bias.adb:$bp_location"
-gdb_test "print x" " = 64"
+gdb_test "print x" " = 60"
gdb_test "print y" " = -5"
gdb_test "print cval" " = 65"
@@ -44,11 +44,11 @@ gdb_test "print y = y" " = true"
gdb_test "print y /= y" " = false"
gdb_test "print y /= y1" " = true"
-gdb_test "print x + x1" " = 65"
+gdb_test "print x + x1" " = 61"
gdb_test "ptype x + x1" "type = range 1 \\.\\. 64"
-gdb_test "print x / x1" " = 64"
-gdb_test "print x * x1" " = 64"
-gdb_test "print x - x1" " = 63"
+gdb_test "print x / x1" " = 60"
+gdb_test "print x * x1" " = 60"
+gdb_test "print x - x1" " = 59"
# Test that storing un-biases.
gdb_test "print x := 5" " = 5"
diff --git a/gdb/testsuite/gdb.ada/bias/bias.adb b/gdb/testsuite/gdb.ada/bias/bias.adb
index abea170..cf24810 100644
--- a/gdb/testsuite/gdb.ada/bias/bias.adb
+++ b/gdb/testsuite/gdb.ada/bias/bias.adb
@@ -23,7 +23,7 @@ procedure Bias is
type Repeat_Count_T is range 1 .. 2 ** 6;
for Repeat_Count_T'Size use 6;
- X : Repeat_Count_T := 64;
+ X : Repeat_Count_T := 60;
X1 : Repeat_Count_T := 1;
type Char_Range is range 65 .. 68;