]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.base/endianity.exp
Update copyright year range in all GDB files
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / endianity.exp
1 # Copyright 2019-2021 Free Software Foundation, Inc.
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
16 standard_testfile .c
17
18 set test_sso [expr \
19 [supports_scalar_storage_order_attribute] \
20 && [supports_gnuc]]
21
22 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
23 [list debug additional_flags=-DTEST_SSO=$test_sso]] } {
24 return -1
25 }
26
27 set bp_location [gdb_get_line_number "START"]
28 if ![runto "endianity.c:$bp_location" ] then {
29 fail "couldn't run to start"
30 return -1
31 }
32
33 gdb_test "print o" "= {v = 3, w = 2, x = 7, f = 23.5, cplx = 1.25 \\+ 7.25i, d = 75}" \
34 "print o before assignment"
35
36 gdb_test "print o.v = 4" "= 4"
37 gdb_test "print o.w = 3" "= 3"
38 gdb_test "print o.x = 2" "= 2"
39 gdb_test "print o.f = 1.5" "= 1.5"
40 gdb_test "print o.d = -23.125" "= -23.125"
41
42 gdb_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
45 if { !$test_sso } {
46 # The rest of the testcase requires Scalar Storage Order support.
47 # This compiler does not support it, so skip the rest.
48 unsupported "No scalar storage order support"
49 return -1
50 }
51
52 gdb_test "x/x &o.v" "0x04000000"
53 gdb_test "x/xh &o.w" "0x0300"