X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Ftestsuite%2Fgdb.ada%2Farray_return.exp;h=aef1e64f6eec52e60bb900dcad62898a41b52df5;hb=d835a58baae720abe909795cb68763040d1750a8;hp=c2ede2c93199ec9aaa507ee58094ebfa11776335;hpb=01f0fe5e0450edf168c1f612feb93cf588e4e7ea;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/testsuite/gdb.ada/array_return.exp b/gdb/testsuite/gdb.ada/array_return.exp index c2ede2c931..aef1e64f6e 100644 --- a/gdb/testsuite/gdb.ada/array_return.exp +++ b/gdb/testsuite/gdb.ada/array_return.exp @@ -1,8 +1,8 @@ -# Copyright 2005 Free Software Foundation, Inc. +# Copyright 2005-2020 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 -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, @@ -11,35 +11,24 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -# MA 02110-1301, USA - -if $tracelevel then { - strace $tracelevel -} +# along with this program. If not, see . 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 } @@ -54,12 +43,16 @@ gdb_test "break create_large" \ "Breakpoint \[0-9\]+ at.*: file .*pck.adb, line \[0-9\]+." \ "insert breakpoint in create_large" +gdb_test "break create_small_float_vector" \ + "Breakpoint \[0-9\]+ at.*: file .*pck.adb, line \[0-9\]+." \ + "insert breakpoint in create_small_float_vector" + # Then continue until reaching the first breakpoint inside Create_Small, # and then do a "finish". 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\\)" \ @@ -70,7 +63,7 @@ gdb_test "finish" \ 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 @@ -84,3 +77,14 @@ gdb_test "finish" \ "Value returned is \\\$\[0-9\]+ = \\(2, 2, 2, 2\\)" \ "value printed by finish of Create_Large" +# Now continue until reaching the third breakpoint, and then do another +# "finish" again. + +gdb_test "cont" \ + "Breakpoint \[0-9\]+, pck.create_small_float_vector \\(\\).*" \ + "continuing to Create_Small_Float_Vector" + +gdb_test "finish" \ + "Value returned is \\\$\[0-9\]+ = \\(4.25, 4.25\\)" \ + "value printed by finish of Create_Small_Float_Vector" +