aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-12-13 17:22:40 +0100
committerTom de Vries <tdevries@suse.de>2020-12-13 17:22:40 +0100
commit862fcbd8f02b03cbf37b452e35bff8361d7a0208 (patch)
tree65a5f791fb015da9692b367267463b8dfd94a2af /gdb
parenta406a98e6e061ac865747ac2d2ba73a2ecaab081 (diff)
downloadgdb-862fcbd8f02b03cbf37b452e35bff8361d7a0208.zip
gdb-862fcbd8f02b03cbf37b452e35bff8361d7a0208.tar.gz
gdb-862fcbd8f02b03cbf37b452e35bff8361d7a0208.tar.bz2
[gdb/testsuite] Fix gdb.base/endianity.exp with gcc-4.8
When running test-case gdb.base/endianity.exp using gcc-4.8, we get: ... (gdb) x/x &o.v^M 0x7fffffffd120: 0x00000004^M (gdb) XFAIL: gdb.base/endianity.exp: x/x &o.v x/xh &o.w^M 0x7fffffffd124: 0x0003^M (gdb) FAIL: gdb.base/endianity.exp: x/xh &o.w ... The gcc 4.8 compiler does not support the scalar_storage_order attribute, so the testcase is compiled without that attribute, and the expected results are different. Fix this by rather than xfailing, skipping the tests if the compiler does not support the scalar_storage_order attribute. Tested on x86_64-linux, with gcc-4.8, gcc-7, and clang-10. gdb/testsuite/ChangeLog: 2020-12-13 Tom de Vries <tdevries@suse.de> PR testsuite/26953 * gdb.base/endianity.exp: Skip tests requiring scalar_storage_order attribute support if compiler doesn't support it.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.base/endianity.exp11
2 files changed, 13 insertions, 4 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index ca72392..c33f0b2 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2020-12-13 Tom de Vries <tdevries@suse.de>
+ PR testsuite/26953
+ * gdb.base/endianity.exp: Skip tests requiring scalar_storage_order
+ attribute support if compiler doesn't support it.
+
+2020-12-13 Tom de Vries <tdevries@suse.de>
+
* lib/gdb.exp (gdb_compile_shlib): Handle ada.
* gdb.ada/catch_ex_std.exp: Use gdb_compile_shlib to compile from
source to shared lib. Add ada to options.
diff --git a/gdb/testsuite/gdb.base/endianity.exp b/gdb/testsuite/gdb.base/endianity.exp
index 2fa9ed3..4520799 100644
--- a/gdb/testsuite/gdb.base/endianity.exp
+++ b/gdb/testsuite/gdb.base/endianity.exp
@@ -34,12 +34,15 @@ 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"
-# scalar_storage_order requires gcc >= 6
+gdb_test "print o" "= {v = 4, w = 3, x = 2, f = 1.5, cplx = 1.25 \\+ 7.25i, d = -23.125}" \
+ "print o after assignment"
+
if { ([test_compiler_info {gcc-[0-5]-*}] || ![test_compiler_info gcc*]) } {
- setup_xfail "*-*-*"
+ # The rest of the testcase requires Scalar Storage Order support.
+ # This compiler does not support it, so skip the rest.
+ return -1
}
+
gdb_test "x/x &o.v" "0x04000000"
gdb_test "x/xh &o.w" "0x0300"
-gdb_test "print o" "= {v = 4, w = 3, x = 2, f = 1.5, cplx = 1.25 \\+ 7.25i, d = -23.125}" \
- "print o after assignment"