Add translations for various sub-directories
[binutils-gdb.git] / gdb / testsuite / gdb.ada / inline-section-gc.exp
blobe1d85f580c1f8378e00ff6949b46f8b6188d24b0
1 # Copyright 2022-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 load_lib "ada.exp"
18 require allow_ada_tests
20 standard_ada_testfile caller
22 set options {
23     debug
24     optimize=-O2
25     additional_flags=-ffunction-sections
26     ldflags=-largs
27     ldflags=-Wl,--gc-sections
28     ldflags=-margs
29     additional_flags=-gnatn
31 if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $options] != ""} {
32     return -1
35 clean_restart ${testfile}
38 # Depending on the version of gnat, the location of the set breakpoint may
39 # be reported as being at the requested location in file callee.adb or in
40 # file caller.adb where the callee function was inlined.  Either way, only
41 # one breakpoint should be reported and its address should not be at 0x0.
42 set bp_location1 [gdb_get_line_number "BREAK" ${testdir}/callee.adb]
43 set bp_location2 [gdb_get_line_number "CALLEE_LOC" ${testdir}/caller.adb]
44 set test "break callee.adb:$bp_location1"
45 set message "Breakpoint set"
47 # The bug here was that gdb would set a breakpoint with two locations,
48 # one of them at 0x0.
49 gdb_test_multiple $test $message {
50     -re "Breakpoint $decimal at $hex: file .*callee.adb, line $bp_location1." {
51         pass $test
52     }
53     -re "Breakpoint $decimal at $hex: file .*caller.adb, line $bp_location2." {
54         pass $test
55     }