Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / endianity.exp
CommitLineData
88b9d363 1# Copyright 2019-2022 Free Software Foundation, Inc.
34877895
PJ
2
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 3 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16standard_testfile .c
17
60108e47
TV
18set test_sso [expr \
19 [supports_scalar_storage_order_attribute] \
20 && [supports_gnuc]]
21
22if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
23 [list debug additional_flags=-DTEST_SSO=$test_sso]] } {
34877895
PJ
24 return -1
25}
26
27set bp_location [gdb_get_line_number "START"]
28if ![runto "endianity.c:$bp_location" ] then {
29 fail "couldn't run to start"
30 return -1
31}
32
981c08ce 33gdb_test "print o" "= {v = 3, w = 2, x = 7, f = 23.5, cplx = 1.25 \\+ 7.25i, d = 75}" \
103a685e 34 "print o before assignment"
34877895
PJ
35
36gdb_test "print o.v = 4" "= 4"
37gdb_test "print o.w = 3" "= 3"
4139ff00 38gdb_test "print o.x = 2" "= 2"
103a685e
TT
39gdb_test "print o.f = 1.5" "= 1.5"
40gdb_test "print o.d = -23.125" "= -23.125"
34877895 41
862fcbd8
TV
42gdb_test "print o" "= {v = 4, w = 3, x = 2, f = 1.5, cplx = 1.25 \\+ 7.25i, d = -23.125}" \
43 "print o after assignment"
44
60108e47 45if { !$test_sso } {
862fcbd8
TV
46 # The rest of the testcase requires Scalar Storage Order support.
47 # This compiler does not support it, so skip the rest.
60108e47 48 unsupported "No scalar storage order support"
862fcbd8 49 return -1
34877895 50}
862fcbd8 51
34877895
PJ
52gdb_test "x/x &o.v" "0x04000000"
53gdb_test "x/xh &o.w" "0x0300"
This page took 0.285407 seconds and 4 git commands to generate.