]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.dwarf2/self-spec.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.dwarf2 / self-spec.exp
CommitLineData
1d506c26 1# Copyright 2023-2024 Free Software Foundation, Inc.
eeee4389
TV
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 doesn't hang or segfault on reading a DIE with a
8d83f51b 17# specification/abstract_origin reference to itself.
eeee4389
TV
18
19load_lib dwarf.exp
20
21require dwarf2_support
22
23standard_testfile main.c .S
24
25# Create the DWARF.
26set asm_file [standard_output_file $srcfile2]
27Dwarf::assemble $asm_file {
28 cu {} {
29 compile_unit {{language @DW_LANG_C_plus_plus}} {
8d83f51b 30 # Check handling of self-referencing DIE.
eeee4389
TV
31 declare_labels c1
32 c1: class_type {
33 {name c1}
34 {specification :$c1}
35 }
8d83f51b
TV
36
37 # Check handling of self-referencing child DIE. Regression test
38 # for PR30799.
39 declare_labels f1 abstract_f1 f1_l
40 abstract_f1: subprogram {}
41 f1: subprogram {
42 {MACRO_AT_func {main}}
43 {abstract_origin :$abstract_f1}
44 } {
45 f1_l: label {
46 {abstract_origin :$f1_l}
47 }
48 }
eeee4389
TV
49 }
50 }
51}
52
53if [prepare_for_testing "failed to prepare" $testfile "${asm_file} ${srcfile}" {}] {
54 return -1
55}
56
57set index [have_index $binfile]
58require {string eq $index ""}
59
60require !readnow
61
62gdb_test "maint print objfiles $testfile" \
63 "\r\n *qualified: *c1\r\n.*" \
64 "class c1 in cooked index"
65
66gdb_test "maint expand-symtabs"