-# Copyright 2005, 2006, 2007 Free Software Foundation, Inc.
+# Copyright 2005-2019 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if $tracelevel then {
- strace $tracelevel
-}
-
load_lib "ada.exp"
-set testdir "array_return"
-set testfile "${testdir}/p"
-set srcfile ${srcdir}/${subdir}/${testfile}.adb
-set binfile ${objdir}/${subdir}/${testfile}
+if { [skip_ada_tests] } { return -1 }
+
+standard_ada_testfile p
-file mkdir ${objdir}/${subdir}/${testdir}
-if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return -1
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
+ return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${testfile}
# Start the inferior
if ![runto_main] then {
- fail "Cannot run to main, testcase aborted"
+ fail "cannot run to main, testcase aborted"
return 0
}
gdb_test "cont" \
"Breakpoint \[0-9\]+, pck.create_small \\(\\).*" \
- "Continuing to Create_Small"
+ "continuing to Create_Small"
gdb_test "finish" \
"Value returned is \\\$\[0-9\]+ = \\(1, 1\\)" \
gdb_test "cont" \
"Breakpoint \[0-9\]+, pck.create_large \\(\\).*" \
- "Continuing to Create_Large"
+ "continuing to Create_Large"
# On hppa32, the value returned is too large to be returned via a register.
# Instead, it is returned using the struct convention, and the debugger
gdb_test "cont" \
"Breakpoint \[0-9\]+, pck.create_small_float_vector \\(\\).*" \
- "Continuing to Create_Small_Float_Vector"
+ "continuing to Create_Small_Float_Vector"
gdb_test "finish" \
"Value returned is \\\$\[0-9\]+ = \\(4.25, 4.25\\)" \