From: Joel Brobecker Date: Mon, 11 Dec 2017 05:55:36 +0000 (-0500) Subject: Adapt gdb.ada/variant_record_packed_array.exp to accept reordered components X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c5f9cfc894373abd00ee56c6723ee0ba95a84f95;p=binutils-gdb.git Adapt gdb.ada/variant_record_packed_array.exp to accept reordered components Recent versions of GNAT are capable of reordering record components to make their access for efficient. This patch adapts this test to accept both cases (reordered or not). gdb/testsuite/ChangeLog: * gdb.ada/variant_record_packed_array.exp: Adapt test to accept output with components being reordered. Tested on x86_64-linux. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 87ecb23306e..28dfa14d7c6 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-12-11 Joel Brobecker + + * gdb.ada/variant_record_packed_array.exp: Adapt test to accept + output with components being reordered. + 2017-12-11 Joel Brobecker * gdb.ada/pkd_arr_elem.exp: Adapt "print test" test to accept diff --git a/gdb/testsuite/gdb.ada/variant_record_packed_array.exp b/gdb/testsuite/gdb.ada/variant_record_packed_array.exp index 95055426bfc..b3fc5b5209f 100644 --- a/gdb/testsuite/gdb.ada/variant_record_packed_array.exp +++ b/gdb/testsuite/gdb.ada/variant_record_packed_array.exp @@ -26,14 +26,26 @@ clean_restart ${testfile} set bp_location [gdb_get_line_number "START" ${testdir}/foo.adb] runto "foo.adb:$bp_location" -gdb_test "print my_buffer" \ - "= \\(size => 8, buffer => \\(1, 2, 3, 4, 5, 6, 7, 0\\), length => 8\\)" \ - "print empty" +set test "print my_buffer" +gdb_test_multiple "$test" $test { + -re "= \\(size => 8, buffer => \\(1, 2, 3, 4, 5, 6, 7, 0\\), length => 8\\)\[\r\n\]+$gdb_prompt $" { + pass $test + } + -re "= \\(size => 8, length => 8, buffer => \\(1, 2, 3, 4, 5, 6, 7, 0\\)\\)\[\r\n\]+$gdb_prompt $" { + pass $test + } +} gdb_test "print my_buffer'Address" \ "= \\(system\\.address\\) $hex" \ "print address" -gdb_test "print {foo.octal_buffer} ($)" \ - "= \\(size => 8, buffer => \\(1, 2, 3, 4, 5, 6, 7, 0\\), length => 8\\)" \ - "print adress content" +set test "print {foo.octal_buffer} ($)" +gdb_test_multiple "$test" $test { + -re "= \\(size => 8, buffer => \\(1, 2, 3, 4, 5, 6, 7, 0\\), length => 8\\)\[\r\n\]+$gdb_prompt $" { + pass $test + } + -re "= \\(size => 8, length => 8, buffer => \\(1, 2, 3, 4, 5, 6, 7, 0\\)\\)\[\r\n\]+$gdb_prompt $" { + pass $test + } +}