aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-11-25 13:37:15 -0700
committerTom Tromey <tromey@adacore.com>2019-12-04 09:31:18 -0700
commit4139ff008829d716830d18e8cfa8cbf5c0ae7562 (patch)
treea304891f091b90fe74860cc7cca66b3ec4ee5518 /gdb/testsuite
parenta05cf17ab92357449ed62fa0d1bac7389ee2de09 (diff)
downloadgdb-4139ff008829d716830d18e8cfa8cbf5c0ae7562.zip
gdb-4139ff008829d716830d18e8cfa8cbf5c0ae7562.tar.gz
gdb-4139ff008829d716830d18e8cfa8cbf5c0ae7562.tar.bz2
Add bit-field test for scalar_storage_order
This adds a bit-field test for scalar_storage_order. gdb/testsuite/ChangeLog 2019-12-04 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
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.base/endianity.c3
-rw-r--r--gdb/testsuite/gdb.base/endianity.exp5
3 files changed, 11 insertions, 3 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 3ba3692..2d45592 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2019-12-04 Tom Tromey <tromey@adacore.com>
+ * gdb.base/endianity.c (struct other) <x>: New field.
+ (main): Initialize it.
+ * gdb.base/endianity.exp: Update.
+
+2019-12-04 Tom Tromey <tromey@adacore.com>
+
* gdb.ada/scalar_storage/storage.adb: New file.
* gdb.ada/scalar_storage/pck.adb: New file.
* gdb.ada/scalar_storage/pck.ads: New file.
diff --git a/gdb/testsuite/gdb.base/endianity.c b/gdb/testsuite/gdb.base/endianity.c
index 42ee9ae..17e5035 100644
--- a/gdb/testsuite/gdb.base/endianity.c
+++ b/gdb/testsuite/gdb.base/endianity.c
@@ -21,6 +21,7 @@ struct otherendian
{
int v;
short w;
+ unsigned x : 3;
float f;
__complex__ float cplx;
double d;
@@ -42,7 +43,7 @@ do_nothing (struct otherendian *c)
int
main (void)
{
- struct otherendian o = {3, 2, 23.5, 1.25 + 7.25i, 75};
+ struct otherendian o = {3, 2, 7, 23.5, 1.25 + 7.25i, 75};
do_nothing (&o); /* START */
}
diff --git a/gdb/testsuite/gdb.base/endianity.exp b/gdb/testsuite/gdb.base/endianity.exp
index 4277c1f..e4f6bc3 100644
--- a/gdb/testsuite/gdb.base/endianity.exp
+++ b/gdb/testsuite/gdb.base/endianity.exp
@@ -25,11 +25,12 @@ if ![runto "endianity.c:$bp_location" ] then {
return -1
}
-gdb_test "print o" "= {v = 3, w = 2, f = 23.5, cplx = 1.25 \\+ 7.25 \\* I, d = 75}" \
+gdb_test "print o" "= {v = 3, w = 2, x = 7, f = 23.5, cplx = 1.25 \\+ 7.25 \\* I, d = 75}" \
"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"
gdb_test "print o.d = -23.125" "= -23.125"
@@ -40,5 +41,5 @@ if { ([test_compiler_info {gcc-[0-5]-*}] || ![test_compiler_info gcc*]) } {
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, d = -23.125}" \
+gdb_test "print o" "= {v = 4, w = 3, x = 2, f = 1.5, cplx = 1.25 \\+ 7.25 \\* I, d = -23.125}" \
"print o after assignment"