aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-03-25 15:28:35 +0100
committerTom de Vries <tdevries@suse.de>2024-03-25 15:28:35 +0100
commit874f4887f0361e953f7098459ae60a5f894d362a (patch)
tree61b7188f5e01982a9dd6dc2db04ab370e06afbc7
parent61ced226a4fc2e6df7836cd9c0f7e1ad47af2440 (diff)
downloadgdb-874f4887f0361e953f7098459ae60a5f894d362a.zip
gdb-874f4887f0361e953f7098459ae60a5f894d362a.tar.gz
gdb-874f4887f0361e953f7098459ae60a5f894d362a.tar.bz2
[gdb/testsuite] Fix gdb.ada/tagged-lookup.exp with gcc <= 12
With gcc 13, test-case gdb.ada/tagged-lookup.exp passes for me, but with gcc 12, I get: ... (gdb) set debug symtab-create 1^M (gdb) print *the_local_var^M ... $1 = (n => 2)^M (gdb) FAIL: gdb.ada/tagged-lookup.exp: only one CU expanded ... The problem is that this fails: ... -re -wrap ".* = \\\(n => $decimal\\\)" { if {$found_pck + $found_pck2 == 1} { pass $gdb_test_name } else { fail $gdb_test_name } ... because $found_pck == 0 and $found_pck2 == 0. Indeed, with gcc 13 we have: ... $ grep "start_subfile: name = .*/tagged-lookup/" gdb.log | sed 's%.*/%%' b~foo.adb b~foo.adb b~foo.adb b~foo.ads pck2.adb pck2.adb pck2.ads pck2.adb pck2.ads ... and with gcc 12: ... $ grep "start_subfile: name = .*/tagged-lookup/" gdb.log | sed 's%.*/%%' b~foo.adb b~foo.adb b~foo.adb b~foo.ads ... Fix this by checking for "$found_pck + $found_pck2 <= 1" instead. Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com> PR testsuite/31514 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31514
-rw-r--r--gdb/testsuite/gdb.ada/tagged-lookup.exp2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.ada/tagged-lookup.exp b/gdb/testsuite/gdb.ada/tagged-lookup.exp
index 4bc088b..3803319 100644
--- a/gdb/testsuite/gdb.ada/tagged-lookup.exp
+++ b/gdb/testsuite/gdb.ada/tagged-lookup.exp
@@ -52,7 +52,7 @@ gdb_test_multiple "print *the_local_var" "only one CU expanded" -lbl {
exp_continue
}
-re -wrap ".* = \\\(n => $decimal\\\)" {
- if {$found_pck + $found_pck2 == 1} {
+ if {$found_pck + $found_pck2 <= 1} {
pass $gdb_test_name
} else {
fail $gdb_test_name