Update copyright year range in header of all files managed by GDB
[binutils-gdb.git] / gdb / testsuite / gdb.ada / fun_renaming.exp
blobda56e3a6673f4df7230511ed00d8d2acf8cd24eb
1 # Copyright 2015-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 load_lib "ada.exp"
18 if { [skip_ada_tests] } { return -1 }
20 standard_ada_testfile fun_renaming
22 if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
23   return -1
26 clean_restart ${testfile}
28 set bp_location [gdb_get_line_number "BREAK" ${testdir}/fun_renaming.adb]
29 runto "fun_renaming.adb:$bp_location"
31 # Sanity check: make sure we can call a regular global function.
32 gdb_test "print fun_rename_test_next(1)" " = 2"
34 # Starting with GCC 6, renamed subprograms are materialized in the debugging
35 # information: make sure we can call the regular global function using its
36 # multiple names.
38 set test "print fun_rename_test_n(1)"
39 gdb_test_multiple $test $test {
40     -re " = 2\..*$gdb_prompt $"  {
41         pass $test
42     }
43     -re "No definition of \"fun_rename_test_n\" in current context\..*$gdb_prompt $" {
44         if {[test_compiler_info {gcc-6*}]} {
45             fail $test
46         } else {
47             xfail $test
48         }
49     }
52 set test "print renamed_fun_rename_test_next(1)"
53 gdb_test_multiple $test $test {
54     -re " = 2\..*$gdb_prompt $" {
55         pass $test
56     }
57     -re "No definition of \"renamed_fun_rename_test_next\" in current context\..*$gdb_prompt $" {
58         if {[test_compiler_info {gcc-6*}]} {
59             fail $test
60         } else {
61             xfail $test
62         }
63     }
66 set test "print pack.renamed_fun_rename_test_next(1)"
67 gdb_test_multiple $test $test {
68     -re " = 2\..*$gdb_prompt $" {
69         pass $test
70     }
71     -re "No definition of \"pack\.renamed_fun_rename_test_next\" in current context\..*$gdb_prompt $" {
72         if {[test_compiler_info {gcc-6*}]} {
73             fail $test
74         } else {
75             xfail $test
76         }
77     }
78     -re "Type <data variable, no debug info> is not a structure or union type\..*$gdb_prompt $" {
79         if {[test_compiler_info {gcc-6*}]} {
80             fail $test
81         } else {
82             xfail $test
83         }
84     }