aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.ada/scalar_storage.exp
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-11-25 13:04:52 -0700
committerTom Tromey <tromey@adacore.com>2019-12-04 09:31:18 -0700
commita05cf17ab92357449ed62fa0d1bac7389ee2de09 (patch)
tree54ad7a79a294e521fd7987a0ff7e4ca0041acf04 /gdb/testsuite/gdb.ada/scalar_storage.exp
parentd5a22e77b56529eade787419ea80a7e9e7d2aa6f (diff)
downloadgdb-a05cf17ab92357449ed62fa0d1bac7389ee2de09.zip
gdb-a05cf17ab92357449ed62fa0d1bac7389ee2de09.tar.gz
gdb-a05cf17ab92357449ed62fa0d1bac7389ee2de09.tar.bz2
Propagate endianity to subrange types
A subrange type should inherit its endianity from its base type. gdb/ChangeLog 2019-12-04 Tom Tromey <tromey@adacore.com> * gdbtypes.c (create_range_type): Inherit endianity from base type. gdb/testsuite/ChangeLog 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. * gdb.ada/scalar_storage.exp: New file. Change-Id: I2998ab919dc28aeff097763c4242f9bfb90823a3
Diffstat (limited to 'gdb/testsuite/gdb.ada/scalar_storage.exp')
-rw-r--r--gdb/testsuite/gdb.ada/scalar_storage.exp36
1 files changed, 36 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.ada/scalar_storage.exp b/gdb/testsuite/gdb.ada/scalar_storage.exp
new file mode 100644
index 0000000..92ad4ed
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/scalar_storage.exp
@@ -0,0 +1,36 @@
+# Copyright 2019 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test that range types with scalar storage order are handled
+# properly.
+
+load_lib "ada.exp"
+
+standard_ada_testfile storage
+
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
+ return -1
+}
+
+clean_restart ${testfile}
+
+set bp_location [gdb_get_line_number "START" ${testdir}/storage.adb]
+if ![runto "storage.adb:$bp_location" ] then {
+ perror "Couldn't run ${testfile}"
+ return
+}
+
+gdb_test "print V_LE" "= \\(value => 126\\)"
+gdb_test "print V_BE" "= \\(value => 126\\)"