From patchwork Mon Dec 11 05:20:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 24848 Received: (qmail 88545 invoked by alias); 11 Dec 2017 05:25:19 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 86235 invoked by uid 89); 11 Dec 2017 05:20:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 11 Dec 2017 05:20:24 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 5E59A116CC2; Mon, 11 Dec 2017 00:20:23 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id vhfMZKnTSeNL; Mon, 11 Dec 2017 00:20:23 -0500 (EST) Received: from tron.gnat.com (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) by rock.gnat.com (Postfix) with ESMTP id 4FB49116CBE; Mon, 11 Dec 2017 00:20:23 -0500 (EST) Received: by tron.gnat.com (Postfix, from userid 4233) id 48BCA487; Mon, 11 Dec 2017 00:20:23 -0500 (EST) From: Joel Brobecker To: gdb-patches@sourceware.org Cc: Xavier Roirand Subject: [pushed] Adapt gdb.ada/pkd_arr_elem.exp to accept reordered components Date: Mon, 11 Dec 2017 00:20:20 -0500 Message-Id: <1512969620-117985-1-git-send-email-brobecker@adacore.com> 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/pkd_arr_elem.exp: Adapt "print test" test to accept output with components being reordered. Tested on x86_64-linux, and pushed to master. Thank you, diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 48bad29..87ecb23 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-12-11 Joel Brobecker + + * gdb.ada/pkd_arr_elem.exp: Adapt "print test" test to accept + output with components being reordered. + 2017-12-08 Jan Kratochvil Pedro Alves diff --git a/gdb/testsuite/gdb.ada/pkd_arr_elem.exp b/gdb/testsuite/gdb.ada/pkd_arr_elem.exp index 8d3a385..85458aa 100644 --- a/gdb/testsuite/gdb.ada/pkd_arr_elem.exp +++ b/gdb/testsuite/gdb.ada/pkd_arr_elem.exp @@ -28,8 +28,18 @@ clean_restart ${testfile} set bp_location [gdb_get_line_number "START" ${testdir}/failure.adb] runto "failure.adb:$bp_location" -gdb_test "print test" \ - "= \\(size => 100, str => \\(33 'A', nul \\), length => 1\\)" +# Print Test. The order of the components depends on which version of +# the compiler being used, as newer version can re-order the order +# of the components. Accept both known orders. +set test "print test" +gdb_test_multiple "$test" $test { + -re "= \\(size => 100, length => 1, str => \\(33 'A', nul \\)\\).*$gdb_prompt $" { + pass $test + } + -re "= \\(size => 100, str => \\(33 'A', nul \\), length => 1\\).*$gdb_prompt $" { + pass $test + } +} gdb_test "print test.str" \ "= \\(33 'A', nul \\)"