public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] Adapt gdb.ada/variant_record_packed_array.exp to accept reordered components
@ 2017-12-11  6:00 Joel Brobecker
  0 siblings, 0 replies; only message in thread
From: Joel Brobecker @ 2017-12-11  6:00 UTC (permalink / raw)
  To: gdb-patches; +Cc: Xavier Roirand

Hello,

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 and pushed to master.

Thanks,
-- 
Joel

---
 gdb/testsuite/ChangeLog                            |  5 +++++
 .../gdb.ada/variant_record_packed_array.exp        | 24 ++++++++++++++++------
 2 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 87ecb23..28dfa14 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
 2017-12-11  Joel Brobecker  <brobecker@adacore.com>
 
+	* gdb.ada/variant_record_packed_array.exp: Adapt test to accept
+	output with components being reordered.
+
+2017-12-11  Joel Brobecker  <brobecker@adacore.com>
+
 	* gdb.ada/pkd_arr_elem.exp: Adapt "print test" test to accept
 	output with components being reordered.
 
diff --git a/gdb/testsuite/gdb.ada/variant_record_packed_array.exp b/gdb/testsuite/gdb.ada/variant_record_packed_array.exp
index 9505542..b3fc5b5 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
+    }
+}
-- 
2.1.4

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

only message in thread, other threads:[~2017-12-11  6:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-11  6:00 [pushed] Adapt gdb.ada/variant_record_packed_array.exp to accept reordered components Joel Brobecker

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).