gas MMIX: Use more of is_... framework like is_whitespace and is_end_of_stmt
[binutils-gdb.git] / gdb / testsuite / gdb.dlang / circular.exp
blobe6d78d05a4b202e6d3d920c063be089c2427da40
1 # Copyright (C) 2016-2024 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}
40                 }
41                 imported_module {
42                     {import :$circular3_label}
43                 }
44                 imported_module {
45                     {import :$circular4_label}
46                 }
47                 imported_module {
48                     {import :$circular5_label}
49                 }
51                 subprogram {
52                     {external 1 flag_present}
53                     {MACRO_AT_func {found}}
54                 }
55             }
57             circular2_label: module {
58                 {name circular2}
59             } {
60                 imported_module {
61                     {import :$circular1_label}
62                 }
63                 imported_module {
64                     {import :$circular3_label}
65                 }
66                 imported_module {
67                     {import :$circular4_label}
68                 }
69                 imported_module {
70                     {import :$circular5_label}
71                 }
72             }
74             circular3_label: module {
75                 {name circular3}
76             } {
77                 imported_module {
78                     {import :$circular1_label}
79                 }
80                 imported_module {
81                     {import :$circular2_label}
82                 }
83                 imported_module {
84                     {import :$circular4_label}
85                 }
86                 imported_module {
87                     {import :$circular5_label}
88                 }
89             }
91             circular4_label: module {
92                 {name circular4}
93             } {
94                 imported_module {
95                     {import :$circular1_label}
96                 }
97                 imported_module {
98                     {import :$circular2_label}
99                 }
100                 imported_module {
101                     {import :$circular3_label}
102                 }
103                 imported_module {
104                     {import :$circular5_label}
105                 }
106             }
108             circular5_label: module {
109                 {name circular5}
110             } {
111                 imported_module {
112                     {import :$circular1_label}
113                 }
114                 imported_module {
115                     {import :$circular2_label}
116                 }
117                 imported_module {
118                     {import :$circular3_label}
119                 }
120                 imported_module {
121                     {import :$circular4_label}
122                 }
123             }
124         }
125     }
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."