]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.dwarf2/dw5-rnglist-test.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.dwarf2 / dw5-rnglist-test.exp
1 # Copyright 2020-2023 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 # Check that GDB can find the variables in a lexical block with a
17 # DW_FORM_rnglistx DW_AT_ranges field. This test is intended for DWARF-5,
18 # compiled with clang++.
19
20 standard_testfile .cc
21
22 # This test is intended for targets which support DWARF-5.
23 # Since we pass an explicit -gdwarf-5 to the compiler,
24 # we let that be the test of whether the target supports it.
25
26 if { [prepare_for_testing "failed to prepare" "${testfile}" \
27 $srcfile {debug c++ additional_flags=-gdwarf-5 \
28 additional_flags=-O0}] } {
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" ".* break-here .*"
38
39 gdb_test "print curr" "\\\(node \\\*\\\) $hex <node_array>"
40 gdb_test "print *curr" "= {id = 35, left = $hex <node_array\\+$decimal>, right = $hex <node_array\\+$decimal>, visited = false}"