gdb/testsuite: remove XFAIL on gdb.cp/temargs.exp
authorBruno Larsen <blarsen@redhat.com>
Tue, 4 Oct 2022 17:07:46 +0000 (19:07 +0200)
committerBruno Larsen <blarsen@redhat.com>
Fri, 11 Nov 2022 09:13:48 +0000 (10:13 +0100)
gdb.cp/temargs.exp last 2 tests always setup an XFAILs, despite checking
for old gcc versions.  However, Clang does not fail in this test,
turning into XPASSes and slighty annoying when comparing between
compilers.  To change this, make the xfails only happen if we using gcc.

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

index 05fd902bb83db6dd1270f5246d973c5cf60a747c..22c29cc7d8abc1e17edb890cdc24d6f70f2a00d3 100644 (file)
@@ -46,6 +46,8 @@ if {[test_compiler_info {gcc-[0-3]-*}]
     set have_pr_45024_fixed 0
 }
 
+set using_gcc [test_compiler_info gcc-*-*]
+
 set line [gdb_get_line_number "Breakpoint 1" $srcfile]
 gdb_test "break $srcfile:$line" "Breakpoint 2.*" \
     "set first breakpoint for temargs"
@@ -190,10 +192,10 @@ gdb_test "print F" "&S::somefunc" "test value of F in k2_m"
 gdb_continue_to_breakpoint "continue to sixth breakpoint for temargs"
 
 if $have_older_template_gcc { setup_xfail "*-*-*"
-} else { setup_xfail gcc/49546 "*-*-*" }
+} elseif { $using_gcc } { setup_xfail gcc/49546 "*-*-*" }
 gdb_test "ptype F" {type = void \(\*\)\(int\)} "test type of F in k3_m"
 
 if $have_older_template_gcc { setup_xfail "*-*-*"
-} else { setup_xfail gcc/49546 "*-*-*" }
+} elseif { $using_gcc } { setup_xfail gcc/49546 "*-*-*" }
 gdb_test "print F" { = \(void \(\*\)\(int\)\) 0x[0-9a-f]+ <S3::m\(int\)>} \
         "test value of F in k3_m"