[04/11] gdb/testsuite: add XFAIL to gdb.cp/derivation.exp when using clang

Message ID 20221004170747.154307-6-blarsen@redhat.com
State Committed
Headers
Series None |

Commit Message

Guinevere Larsen Oct. 4, 2022, 5:07 p.m. UTC
  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.
---
 gdb/testsuite/gdb.cp/derivation.exp | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Andrew Burgess Oct. 26, 2022, 12:37 p.m. UTC | #1
Bruno Larsen via Gdb-patches <gdb-patches@sourceware.org> writes:

> 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.
> ---
>  gdb/testsuite/gdb.cp/derivation.exp | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/gdb/testsuite/gdb.cp/derivation.exp b/gdb/testsuite/gdb.cp/derivation.exp
> index c95fef004b5..2283e5b3616 100644
> --- a/gdb/testsuite/gdb.cp/derivation.exp
> +++ b/gdb/testsuite/gdb.cp/derivation.exp
> @@ -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

Missing full-stop at the end of the sentence.

> +if {[test_compiler_info {clang*}]} {
> +    setup_xfail "clang 57608" *-*-*
> +}

Add language to test_compiler_info call.

Thanks,
Andrew

>  cp_test_ptype_class \
>      "a_instance" "" "class" "A" \
>      {
> -- 
> 2.37.3
  
Andrew Burgess Oct. 26, 2022, 2:50 p.m. UTC | #2
Bruno Larsen via Gdb-patches <gdb-patches@sourceware.org> writes:

> 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.
> ---
>  gdb/testsuite/gdb.cp/derivation.exp | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/gdb/testsuite/gdb.cp/derivation.exp b/gdb/testsuite/gdb.cp/derivation.exp
> index c95fef004b5..2283e5b3616 100644
> --- a/gdb/testsuite/gdb.cp/derivation.exp
> +++ b/gdb/testsuite/gdb.cp/derivation.exp
> @@ -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

I believe it's 'Clang' with a capital 'C'.

Thanks,
Andrew

> +if {[test_compiler_info {clang*}]} {
> +    setup_xfail "clang 57608" *-*-*
> +}
>  cp_test_ptype_class \
>      "a_instance" "" "class" "A" \
>      {
> -- 
> 2.37.3
  

Patch

diff --git a/gdb/testsuite/gdb.cp/derivation.exp b/gdb/testsuite/gdb.cp/derivation.exp
index c95fef004b5..2283e5b3616 100644
--- a/gdb/testsuite/gdb.cp/derivation.exp
+++ b/gdb/testsuite/gdb.cp/derivation.exp
@@ -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*}]} {
+    setup_xfail "clang 57608" *-*-*
+}
 cp_test_ptype_class \
     "a_instance" "" "class" "A" \
     {