gdb/testsuite: add XFAIL to gdb.cp/derivation.exp when using Clang
authorBruno Larsen <blarsen@redhat.com>
Thu, 8 Sep 2022 08:43:14 +0000 (10:43 +0200)
committerBruno Larsen <blarsen@redhat.com>
Fri, 11 Nov 2022 09:13:36 +0000 (10:13 +0100)
When running gdb.cp/derivation.exp using Clang, we get an unexpected
failure when printing the type of a class with an internal typedef. This
happens because Clang doesn't add accessibility information for typedefs
inside classes (see https://github.com/llvm/llvm-project/issues/57608
for more info). To help with Clang testing, an XFAIL was added to this
test.

Approved-by: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.cp/derivation.exp

index c95fef004b5972db2cc5a6dcbc1d5fe0f0d57819..f49ab208ac9db9cb2530576a35739f43029c7eee 100644 (file)
@@ -77,6 +77,10 @@ gdb_test "up" ".*main.*" "up from marker1"
 
 gdb_test "print a_instance" "\\$\[0-9\]+ = \{a = 1, aa = 2\}" "print value of a_instance"
 
+# Clang does not add accessibility information for typedefs inside classes.
+if {[test_compiler_info {clang*} c++]} {
+    setup_xfail "clang 57608" *-*-*
+}
 cp_test_ptype_class \
     "a_instance" "" "class" "A" \
     {