diff options
Diffstat (limited to 'gdb/testsuite/gdb.ada/arrayptr.exp')
-rw-r--r-- | gdb/testsuite/gdb.ada/arrayptr.exp | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/gdb/testsuite/gdb.ada/arrayptr.exp b/gdb/testsuite/gdb.ada/arrayptr.exp index 0e188bf9943..c3fb5f3d647 100644 --- a/gdb/testsuite/gdb.ada/arrayptr.exp +++ b/gdb/testsuite/gdb.ada/arrayptr.exp @@ -49,38 +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]-*}]} { + set xfail_expected 1 + } 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 $kfail_int128support_re { - kfail gdb/20991 $gdb_test_name + -re -wrap " = \[0-9\]+" { + if { $xfail_expected } { + xfail $gdb_test_name + } else { + fail $gdb_test_name + } } } + 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 $kfail_int128support_re { - kfail gdb/20991 $gdb_test_name - } - -re -wrap $kfail_packed_array_range_re { - kfail gdb/28115 $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 $kfail_int128support_re { - kfail gdb/20991 $gdb_test_name + -re -wrap $xfail_attempt_to_index_re { + if { $xfail_expected } { + xfail $gdb_test_name + } else { + fail $gdb_test_name + } } } } |