Commit | Line | Data |
---|---|---|
4aa866af LS |
1 | # This testcase is part of GDB, the GNU debugger. |
2 | ||
b811d2c2 | 3 | # Copyright 2019-2020 Free Software Foundation, Inc. |
4aa866af LS |
4 | |
5 | # This program is free software; you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
7 | # the Free Software Foundation; either version 3 of the License, or | |
8 | # (at your option) any later version. | |
9 | # | |
10 | # This program is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU General Public License | |
16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
17 | ||
18 | # This testcase exercises evaluation with amd64 calling conventions. | |
19 | ||
2e84f897 LD |
20 | if { ![istarget x86_64-*-* ] || ![is_lp64_target] } { |
21 | verbose "Skipping x86_64 eval test." | |
22 | return | |
23 | } | |
24 | ||
4aa866af LS |
25 | standard_testfile .cc |
26 | ||
27 | if { [prepare_for_testing "failed to prepare" $testfile $srcfile \ | |
669d0468 | 28 | { debug c++ additional_flags=-std=c++11 }] } { |
4aa866af LS |
29 | return -1 |
30 | } | |
31 | ||
32 | if ![runto_main] { | |
33 | return -1 | |
34 | } | |
35 | ||
36 | gdb_breakpoint [gdb_get_line_number "break-here"] | |
37 | gdb_continue_to_breakpoint "break-here" | |
38 | ||
39 | gdb_test "call foo.return_simple_base(12)" \ | |
40 | " = {x = 12}" | |
41 | gdb_test "call foo.return_simple_derived(34)" \ | |
42 | " = {<SimpleBase> = {x = 34}, <No data fields>}" | |
43 | gdb_test "call foo.return_non_trivial_destructor(56)" \ | |
44 | " = {<SimpleBase> = {x = 56}, <No data fields>}" | |
45 | gdb_test "call foo.return_unaligned(78, 9.25)" \ | |
46 | " = {x = 78, y = 9.25}" | |
47 | gdb_test "call foo.return_unaligned_in_base(23, 4.5, 67)" \ | |
48 | " = {<UnalignedFields> = {x = 23, y = 4.5}, x2 = 67}" | |
a59240a4 TT |
49 | gdb_test "call foo.return_bitfields(23, 74)" \ |
50 | " = {fld = 23, fld2 = 74}" |