From patchwork Wed Nov 27 18:48:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 36313 Received: (qmail 60868 invoked by alias); 27 Nov 2019 18:48:27 -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 60755 invoked by uid 89); 27 Nov 2019 18:48:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=HX-Languages-Length:2763, of, ow, 1.5 X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Nov 2019 18:48:06 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 9CA51203A5; Wed, 27 Nov 2019 13:48:04 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 3BCC920555 for ; Wed, 27 Nov 2019 13:48:01 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 1B66228174 for ; Wed, 27 Nov 2019 13:48:01 -0500 (EST) X-Gerrit-PatchSet: 1 Date: Wed, 27 Nov 2019 13:48:01 -0500 From: "Tom Tromey (Code Review)" To: gdb-patches@sourceware.org Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] Add bit-field test for scalar_storage_order X-Gerrit-Change-Id: I9e07d1b3e08e7c3384832b68ef286afe1d11479a X-Gerrit-Change-Number: 731 X-Gerrit-ChangeURL: X-Gerrit-Commit: 45fd074a80a5921783d294562ebb3c00e6c5210c References: Reply-To: tromey@sourceware.org, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/731 ...................................................................... Add bit-field test for scalar_storage_order This adds a bit-field test for scalar_storage_order. gdb/testsuite/ChangeLog 2019-11-27 Tom Tromey * gdb.base/endianity.c (struct other) : New field. (main): Initialize it. * gdb.base/endianity.exp: Update. Change-Id: I9e07d1b3e08e7c3384832b68ef286afe1d11479a --- M gdb/testsuite/ChangeLog M gdb/testsuite/gdb.base/endianity.c M gdb/testsuite/gdb.base/endianity.exp 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 9931534..b92ca87 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2019-11-27 Tom Tromey + * gdb.base/endianity.c (struct other) : New field. + (main): Initialize it. + * gdb.base/endianity.exp: Update. + +2019-11-27 Tom Tromey + * gdb.base/endianity.c (struct otherendian) : New field. (main): Initialize it. * gdb.base/endianity.exp: Update. diff --git a/gdb/testsuite/gdb.base/endianity.c b/gdb/testsuite/gdb.base/endianity.c index 57378c2..6724b22 100644 --- a/gdb/testsuite/gdb.base/endianity.c +++ b/gdb/testsuite/gdb.base/endianity.c @@ -21,6 +21,7 @@ { int v; short w; + unsigned x : 3; float f; __complex__ float cplx; } @@ -41,7 +42,7 @@ int main (void) { - struct otherendian o = {3, 2, 23.5, 1.25 + 7.25i}; + struct otherendian o = {3, 2, 7, 23.5, 1.25 + 7.25i}; do_nothing (&o); /* START */ } diff --git a/gdb/testsuite/gdb.base/endianity.exp b/gdb/testsuite/gdb.base/endianity.exp index a6ddea3..85d6f2c 100644 --- a/gdb/testsuite/gdb.base/endianity.exp +++ b/gdb/testsuite/gdb.base/endianity.exp @@ -25,11 +25,12 @@ return -1 } -gdb_test "print o" "= {v = 3, w = 2, f = 23.5, cplx = 1.25 \\+ 7.25 \\* I}" \ +gdb_test "print o" "= {v = 3, w = 2, x = 7, f = 23.5, cplx = 1.25 \\+ 7.25 \\* I}" \ "print o before assignment" gdb_test "print o.v = 4" "= 4" gdb_test "print o.w = 3" "= 3" +gdb_test "print o.x = 2" "= 2" gdb_test "print o.f = 1.5" "= 1.5" # scalar_storage_order requires gcc >= 6 @@ -39,5 +40,5 @@ gdb_test "x/x &o.v" "0x04000000" gdb_test "x/xh &o.w" "0x0300" -gdb_test "print o" "= {v = 4, w = 3, f = 1.5, cplx = 1.25 \\+ 7.25 \\* I}" \ +gdb_test "print o" "= {v = 4, w = 3, x = 2, f = 1.5, cplx = 1.25 \\+ 7.25 \\* I}" \ "print o after assignment"