1 # Copyright
2019-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
/>.
16 # Regression test to ensure that the order of DW_AT_name and
17 # DW_AT_linkage_name does not affect Ada.
21 # This test can only be run
on targets which support DWARF
-2 and use gas.
22 if {![dwarf2_support
]} {
26 standard_testfile .c
-debug.S
28 #
Set up the DWARF
for the test.
30 set asm_file
[standard_output_file $srcfile2
]
31 Dwarf
::assemble $asm_file
{
32 global srcdir subdir srcfile
36 {DW_AT_language @DW_LANG_Ada95
}
43 b_l
: DW_TAG_base_type
{
44 {DW_AT_byte_size
1 DW_FORM_sdata
}
45 {DW_AT_encoding @DW_ATE_signed
}
48 # Here the
name comes first and the linkage
name second.
50 {name system__namefirst
}
51 {linkage_name __gnat_namefirst
}
52 {MACRO_AT_range
{first
}}
55 # Here the linkage
name comes first and the
name second.
57 {linkage_name __gnat_namesecond
}
58 {name system__namesecond
}
59 {MACRO_AT_range
{second
}}
66 if { [prepare_for_testing
"failed to prepare" ${testfile} \
67 [list $srcfile $asm_file
] {nodebug
}] } {
71 with_test_prefix
"first first" {
72 gdb_test_no_output
"set language ada"
73 gdb_breakpoint
"<__gnat_namefirst>" message
74 gdb_breakpoint
"<__gnat_namesecond>" message
77 # Run the test again
, but this time check the symbols in the other
78 # order. This ensures we are really testing all the paths
--
79 # otherwise
if the first symbol is found
, it will cause symtab
80 # expansion
, which might cause the other symbol to be found.
81 clean_restart $
{testfile
}
83 with_test_prefix
"second first" {
84 gdb_test_no_output
"set language ada"
85 gdb_breakpoint
"<__gnat_namesecond>" message
86 gdb_breakpoint
"<__gnat_namefirst>" message