[pushed 3/3] [gdb/testsuite] Add xfail in gdb.cp/subtypes.exp
Tom de Vries
tdevries@suse.de
Mon Aug 28 11:47:02 GMT 2023
When running test-case gdb.cp/subtypes.exp with gcc 4.8.4, we run into:
...
FAIL: gdb.cp/subtypes.exp: ptype main::Foo
FAIL: gdb.cp/subtypes.exp: ptype main::Bar
FAIL: gdb.cp/subtypes.exp: ptype main::Baz
FAIL: gdb.cp/subtypes.exp: ptype foobar<int>::Foo
FAIL: gdb.cp/subtypes.exp: ptype foobar<int>::Bar
FAIL: gdb.cp/subtypes.exp: ptype foobar<int>::Baz
FAIL: gdb.cp/subtypes.exp: ptype foobar<char>::Foo
FAIL: gdb.cp/subtypes.exp: ptype foobar<char>::Bar
FAIL: gdb.cp/subtypes.exp: ptype foobar<char>::Baz
...
The problem is gcc PR debug/55541, which generates a superfluous
DW_TAG_lexical_block.
Add a corresponding xfail.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.cp/subtypes.exp | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.cp/subtypes.exp b/gdb/testsuite/gdb.cp/subtypes.exp
index 48c9784dd68..11acd75029a 100644
--- a/gdb/testsuite/gdb.cp/subtypes.exp
+++ b/gdb/testsuite/gdb.cp/subtypes.exp
@@ -30,19 +30,43 @@ if {[prepare_for_testing "failed to prepare" $testfile \
return -1
}
+# Xfail for superfluous DW_TAG_lexical_block, gcc PR debug/55541.
+set have_xfail [expr [test_compiler_info gcc-*] && [gcc_major_version] < 5]
+
gdb_test "ptype Outer::Inner::InnerInner" \
"type = struct Outer::Inner::InnerInner.*"
gdb_test "ptype Outer::Inner" "type = struct Outer::Inner.*"
foreach s { Foo Bar Baz } {
- gdb_test "ptype main::$s" "type = struct $s.*"
+ gdb_test_multiple "ptype main::$s" "" {
+ -re -wrap "type = struct $s.*" {
+ pass $gdb_test_name
+ }
+ -re -wrap "No symbol \"$s\" in specified context\\." {
+ if { $have_xfail } {
+ setup_xfail *-*-* gcc/55541
+ }
+ fail $gdb_test_name
+ }
+
+ }
}
gdb_test "ptype Outer::Oenum" "type = enum class Outer::Oenum.*"
foreach t { int char } {
foreach s { Foo Bar Baz } {
- gdb_test "ptype foobar<$t>::$s" "type = struct $s.*"
+ gdb_test_multiple "ptype foobar<$t>::$s" "" {
+ -re -wrap "type = struct $s.*" {
+ pass $gdb_test_name
+ }
+ -re -wrap "No symbol \"$s\" in specified context\\." {
+ if { $have_xfail } {
+ setup_xfail *-*-* gcc/55541
+ }
+ fail $gdb_test_name
+ }
+ }
}
}
--
2.35.3
More information about the Gdb-patches
mailing list