1 # Copyright
2011-2022 Free Software Foundation
, Inc.
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.
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.
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
/>.
20 # This test can only be run
on targets which support DWARF
-2 and use gas.
21 if ![dwarf2_support
] {
25 # This test can only be run
on x86 and amd64 targets
(and not x32
).
26 if { [is_x86_like_target
] } {
28 } elseif
{[istarget
"x86_64-*-*"] && [is_lp64_target]} {
29 set sfile $
{test
}-amd64.S
34 if { [prepare_for_testing
"failed to prepare" "${test}" ${sfile} {nodebug additional_flags=-nostdlib}] } {
42 # Initialize tests to be an empty array.
43 unset
-nocomplain tests
46 proc gdb
-test
{line var value
} {
49 lappend tests
($line
) [list $var $value
0]
52 # Add an XFAIL
'd test. If ARCH_PATTERN is given, and does not match
53 # the target, then the test is simply added and not XFAIL'd.
54 proc xfail
-gdb
-test
{line var value
{arch_pattern
""}} {
58 if {$arch_pattern
!= ""} {
59 if {! [istarget $arch_pattern
]} {
64 lappend tests
($line
) [list $var $value $flag
]
67 proc scan_gdb_tests
{} {
68 global srcdir subdir test
70 set file
"$srcdir/$subdir/$test.c"
75 if {! [regexp
"\{ (gdb-test .+) \} \}" $line ignore test_cmd]} {
86 foreach line
[lsort
[array names tests
]] {
87 gdb_test
"break typeddwarf.c:$line" "Breakpoint .*" \
88 "set breakpoint at typeddwarf.c:$line"
89 gdb_continue_to_breakpoint
"continue to typeddwarf.c:$line"
91 foreach test $tests
($line
) {
92 set var
[lindex $test
0]
93 set value
[lindex $test
1]
94 set should_xfail
[lindex $test
2]
100 gdb_test
"print $var" \
102 "check value of $var at typeddwarf.c:$line"