public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [review] Add bit-field test for scalar_storage_order
@ 2019-11-27 18:48 Tom Tromey (Code Review)
  2019-11-27 22:22 ` Simon Marchi (Code Review)
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Tom Tromey (Code Review) @ 2019-11-27 18:48 UTC (permalink / raw)
  To: gdb-patches

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  <tromey@adacore.com>

	* gdb.base/endianity.c (struct other) <x>: 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  <tromey@adacore.com>
 
+	* gdb.base/endianity.c (struct other) <x>: New field.
+	(main): Initialize it.
+	* gdb.base/endianity.exp: Update.
+
+2019-11-27  Tom Tromey  <tromey@adacore.com>
+
 	* gdb.base/endianity.c (struct otherendian) <f>: 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"

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I9e07d1b3e08e7c3384832b68ef286afe1d11479a
Gerrit-Change-Number: 731
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-MessageType: newchange

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-12-04 16:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-27 18:48 [review] Add bit-field test for scalar_storage_order Tom Tromey (Code Review)
2019-11-27 22:22 ` Simon Marchi (Code Review)
2019-12-03 21:34 ` Tom Tromey (Code Review)
2019-12-04 14:34 ` Tom Tromey (Code Review)
2019-12-04 14:36 ` Tom Tromey (Code Review)
2019-12-04 14:36 ` [review v2] " Tom Tromey (Code Review)
2019-12-04 15:46 ` Simon Marchi (Code Review)
2019-12-04 16:41 ` [pushed] " Sourceware to Gerrit sync (Code Review)

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