runto "fun_renaming.adb:$bp_location"
# Sanity check: make sure we can call a regular global function.
-gdb_test "print next(1)" " = 2"
+gdb_test "print fun_rename_test_next(1)" " = 2"
# Starting with GCC 6, renamed subprograms are materialized in the debugging
# information: make sure we can call the regular global function using its
# multiple names.
-set test "print n(1)"
+set test "print fun_rename_test_n(1)"
gdb_test_multiple $test $test {
-re " = 2\..*$gdb_prompt $" {
pass $test
}
- -re "No definition of \"n\" in current context\..*$gdb_prompt $" {
+ -re "No definition of \"fun_rename_test_n\" in current context\..*$gdb_prompt $" {
if {[test_compiler_info {gcc-6*}]} {
fail $test
} else {
}
}
-set test "print renamed_next(1)"
+set test "print renamed_fun_rename_test_next(1)"
gdb_test_multiple $test $test {
-re " = 2\..*$gdb_prompt $" {
pass $test
}
- -re "No definition of \"renamed_next\" in current context\..*$gdb_prompt $" {
+ -re "No definition of \"renamed_fun_rename_test_next\" in current context\..*$gdb_prompt $" {
if {[test_compiler_info {gcc-6*}]} {
fail $test
} else {
}
}
-set test "print pack.renamed_next(1)"
+set test "print pack.renamed_fun_rename_test_next(1)"
gdb_test_multiple $test $test {
-re " = 2\..*$gdb_prompt $" {
pass $test
}
- -re "No definition of \"pack\.renamed_next\" in current context\..*$gdb_prompt $" {
+ -re "No definition of \"pack\.renamed_fun_rename_test_next\" in current context\..*$gdb_prompt $" {
if {[test_compiler_info {gcc-6*}]} {
fail $test
} else {
with Pack;
procedure Fun_Renaming is
- function N (I : Integer) return Integer renames Pack.Next;
+ function Fun_Rename_Test_N (I : Integer) return Integer
+ renames Pack.Fun_Rename_Test_Next;
begin
- Pack.Discard (N (1)); -- BREAK
- Pack.Discard (Pack.Renamed_Next (1)); -- BREAK
+ Pack.Discard (Fun_Rename_Test_N (1)); -- BREAK
+ Pack.Discard (Pack.Renamed_Fun_Rename_Test_Next (1)); -- BREAK
end Fun_Renaming;
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package body Pack is
- function Next (I : Integer) return Integer is
+ function Fun_Rename_Test_Next (I : Integer) return Integer is
begin
return I + 1;
- end Next;
+ end Fun_Rename_Test_Next;
procedure Discard (I : Integer) is
begin
package Pack is
- function Next (I : Integer) return Integer;
- function Renamed_Next (I : Integer) return Integer renames Next;
+ function Fun_Rename_Test_Next (I : Integer) return Integer;
+ function Renamed_Fun_Rename_Test_Next (I : Integer) return Integer
+ renames Fun_Rename_Test_Next;
procedure Discard (I : Integer);
end Pack;