Revert "[gdb/testsuite] Clean standard_output_file dir in gdb_init"
[binutils-gdb.git] / gdb / testsuite / gdb.dlang / circular.exp
blob2c54c5c72a4f567329b866550ef789c173ae5eef
1 # Copyright (C) 2016-2023 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/>.
16 # Test symbol lookup when there are multiple circular imports.
18 load_lib "d-support.exp"
19 load_lib "dwarf.exp"
21 require allow_d_tests dwarf2_support
23 standard_testfile circular.c circular-dw.S
25 # Make some DWARF for the test.
26 set asm_file [standard_output_file $srcfile2]
27 Dwarf::assemble $asm_file {
28 cu {} {
29 compile_unit {
30 {language @DW_LANG_D}
31 } {
32 declare_labels circular1_label circular2_label circular3_label
33 declare_labels circular4_label circular5_label
35 circular1_label: module {
36 {name circular1}
37 } {
38 imported_module {
39 {import :$circular2_label}
41 imported_module {
42 {import :$circular3_label}
44 imported_module {
45 {import :$circular4_label}
47 imported_module {
48 {import :$circular5_label}
51 subprogram {
52 {external 1 flag_present}
53 {MACRO_AT_func {found}}
57 circular2_label: module {
58 {name circular2}
59 } {
60 imported_module {
61 {import :$circular1_label}
63 imported_module {
64 {import :$circular3_label}
66 imported_module {
67 {import :$circular4_label}
69 imported_module {
70 {import :$circular5_label}
74 circular3_label: module {
75 {name circular3}
76 } {
77 imported_module {
78 {import :$circular1_label}
80 imported_module {
81 {import :$circular2_label}
83 imported_module {
84 {import :$circular4_label}
86 imported_module {
87 {import :$circular5_label}
91 circular4_label: module {
92 {name circular4}
93 } {
94 imported_module {
95 {import :$circular1_label}
97 imported_module {
98 {import :$circular2_label}
100 imported_module {
101 {import :$circular3_label}
103 imported_module {
104 {import :$circular5_label}
108 circular5_label: module {
109 {name circular5}
111 imported_module {
112 {import :$circular1_label}
114 imported_module {
115 {import :$circular2_label}
117 imported_module {
118 {import :$circular3_label}
120 imported_module {
121 {import :$circular4_label}
128 if { [prepare_for_testing "failed to prepare" ${testfile} \
129 [list $srcfile $asm_file] {nodebug}] } {
130 return -1
133 gdb_test_no_output "set language d"
135 if {![runto "circular1.found"]} {
136 return -1
139 # This last test shouldn't timeout.
140 gdb_test "print notfound" "No symbol \"notfound\" in current context."