public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [committed][gdb/testsuite] Fix KPASS in gdb.ada/arrayptr.exp
@ 2022-04-04  8:57 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2022-04-04  8:57 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

Hi,

On openSUSE Leap 15.3 I run into:
...
KPASS: gdb.ada/arrayptr.exp: scenario=minimal: print pa_ptr.all \
  (PRMS minimal encodings)
KPASS: gdb.ada/arrayptr.exp: scenario=minimal: print pa_ptr(3) \
  (PRMS minimal encodings)
KPASS: gdb.ada/arrayptr.exp: scenario=minimal: print pa_ptr.all(3) \
  (PRMS minimal encodings)
...

The test-case KFAILs some tests.  However, the analysis in the corresponding
PR talks of a compiler problem, so it should use XFAILs instead.

The KFAILs are setup for pre-gcc-12, but apparantly the fix has been
backported to system compiler 7.5.0, hence the KPASS.

Fix this by:
- using an XFAIL instead of a KFAIL
- matching the specific gdb output that corresponds to the XFAILs
  (reproduced on Fedora 34).

Tested on x86_64-linux, specifically openSUSE Leap 15.3 and Fedora 34.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix KPASS in gdb.ada/arrayptr.exp

---
 gdb/testsuite/gdb.ada/arrayptr.exp | 61 ++++++++++++++++++++++++++++----------
 1 file changed, 45 insertions(+), 16 deletions(-)

diff --git a/gdb/testsuite/gdb.ada/arrayptr.exp b/gdb/testsuite/gdb.ada/arrayptr.exp
index 23e89759666..c3fb5f3d647 100644
--- a/gdb/testsuite/gdb.ada/arrayptr.exp
+++ b/gdb/testsuite/gdb.ada/arrayptr.exp
@@ -49,27 +49,56 @@ foreach_with_prefix scenario {all minimal} {
 
     gdb_test "ptype string_access" "= access array \\(<>\\) of character"
 
-    set kfail_int128support_re \
-	"That operation is not available on integers of more than 8 bytes\\."
-    set kfail_packed_array_range_re \
-	"cannot subscript or call something of type `foo__packed_array_ptr'"
-
     # GNAT >= 12.0 has the needed fix here.
+    set xfail_expected 0
     if {$scenario == "minimal" && ![test_compiler_info {gcc-1[2-9]-*}]} {
-	setup_kfail "minimal encodings" *-*-*
+	set xfail_expected 1
     }
-    gdb_test "print pa_ptr.all" \
-	" = \\(10, 20, 30, 40, 50, 60, 62, 63, -23, 42\\)"
 
-    # GNAT >= 12.0 has the needed fix here.
-    if {$scenario == "minimal" && ![test_compiler_info {gcc-1[2-9]-*}]} {
-	setup_kfail "minimal encodings" *-*-*
+    gdb_test_multiple "print pa_ptr.all" "" {
+	-re -wrap " = \\(10, 20, 30, 40, 50, 60, 62, 63, -23, 42\\)" {
+	    pass $gdb_test_name
+	}
+	-re -wrap " = \[0-9\]+" {
+	    if { $xfail_expected } {
+		xfail $gdb_test_name
+	    } else {
+		fail $gdb_test_name
+	    }
+	}
     }
-    gdb_test "print pa_ptr(3)" " = 30"
 
-    # GNAT >= 12.0 has the needed fix here.
-    if {$scenario == "minimal" && ![test_compiler_info {gcc-1[2-9]-*}]} {
-	setup_kfail "minimal encodings" *-*-*
+    set xfail_cannot_subscript_re \
+	"cannot subscript or call something of type `foo__packed_array_ptr'"
+
+    gdb_test_multiple "print pa_ptr(3)" "" {
+	-re -wrap " = 30" {
+	    pass $gdb_test_name
+
+	}
+	-re -wrap $xfail_cannot_subscript_re {
+	    if { $xfail_expected } {
+		xfail $gdb_test_name
+	    } else {
+		fail $gdb_test_name
+	    }
+	}
+    }
+
+    set xfail_attempt_to_index_re \
+	"Attempt to index or call something other than an array or function"
+
+    gdb_test_multiple "print pa_ptr.all(3)" "" {
+	-re -wrap " = 30" {
+	    pass $gdb_test_name
+
+	}
+	-re -wrap $xfail_attempt_to_index_re {
+	    if { $xfail_expected } {
+		xfail $gdb_test_name
+	    } else {
+		fail $gdb_test_name
+	    }
+	}
     }
-    gdb_test "print pa_ptr.all(3)" " = 30"
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-04  8:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-04  8:57 [committed][gdb/testsuite] Fix KPASS in gdb.ada/arrayptr.exp Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).