]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
kfail an Ada test for GCC < 12
authorTom Tromey <tromey@adacore.com>
Mon, 17 Oct 2022 19:16:59 +0000 (13:16 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 17 Oct 2022 19:20:00 +0000 (13:20 -0600)
I noticed one particular Ada test was failing on Fedora 34, but works
when I switch to GCC 12.  This patch arranges to kfail the test when
an older compiler is used.

I tested this with GCC 11, 12, and 13.  I'm going to check it in.

gdb/testsuite/gdb.ada/packed_array_assign.exp

index eef0d39b6a8441cf99981839033ea6b1bf1da554..a0240fc17be94b1822f0c691c2379070839f888f 100644 (file)
@@ -52,6 +52,12 @@ set re \
         "\\(packed_array_assign_w => 23," \
         "packed_array_assign_x => 7," \
         "packed_array_assign_y => 1\\)\\)"]
+
+# GNAT >= 12.0 has the needed fix here.
+set zeros_expected [expr {![test_compiler_info {gcc-1[2-9]-*}]}]
+set all_zeros \
+    [string_to_regexp "((packed_array_assign_w => 0, packed_array_assign_x => 0, packed_array_assign_y => 0), (packed_array_assign_w => 0, packed_array_assign_x => 0, packed_array_assign_y => 0), (packed_array_assign_w => 0, packed_array_assign_x => 0, packed_array_assign_y => 0))"]
+
 set re [join $re]
 gdb_test_multiple $cmd "value of pra" {
     -re -wrap $re {
@@ -60,6 +66,12 @@ gdb_test_multiple $cmd "value of pra" {
     -re -wrap $kfail_int128support_re {
        kfail gdb/20991 $gdb_test_name
     }
+    -re -wrap $all_zeros {
+       if {$zeros_expected} {
+           setup_kfail "GCC 12 needed" *-*-*
+       }
+       fail $gdb_test_name
+    }
 }
 
 set cmd "print pra(1) := pr"