mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-14 12:40:58 +08:00
gdb/testsuite: add XFAIL to gdb.cp/ptype-flags.exp when using clang
When running gdb.cp/ptype-flags.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.
This commit is contained in:
@ -30,11 +30,18 @@ if ![runto_main] then {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if {[test_compiler_info {clang-*-*} c++]} {
|
||||||
|
set using_clang true
|
||||||
|
} else {
|
||||||
|
set using_clang false
|
||||||
|
}
|
||||||
|
|
||||||
gdb_test_no_output "set language c++" ""
|
gdb_test_no_output "set language c++" ""
|
||||||
gdb_test_no_output "set width 0" ""
|
gdb_test_no_output "set width 0" ""
|
||||||
|
|
||||||
proc do_check_holder {name {flags ""} {show_typedefs 1} {show_methods 1}
|
proc do_check_holder {name {flags ""} {show_typedefs 1} {show_methods 1}
|
||||||
{raw 0}} {
|
{raw 0}} {
|
||||||
|
global using_clang
|
||||||
|
|
||||||
set contents {
|
set contents {
|
||||||
{ base "public Base<T>" }
|
{ base "public Base<T>" }
|
||||||
@ -49,6 +56,11 @@ proc do_check_holder {name {flags ""} {show_typedefs 1} {show_methods 1}
|
|||||||
}
|
}
|
||||||
|
|
||||||
if {$show_typedefs} {
|
if {$show_typedefs} {
|
||||||
|
# Clang does not add accessibility information for typedefs:
|
||||||
|
# https://github.com/llvm/llvm-project/issues/57608
|
||||||
|
if {$using_clang} {
|
||||||
|
setup_xfail "clang 57608" *-*-*
|
||||||
|
}
|
||||||
lappend contents { typedef public "typedef Simple<Simple<T> > Z;" }
|
lappend contents { typedef public "typedef Simple<Simple<T> > Z;" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user