From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23118 invoked by alias); 26 Dec 2006 05:51:55 -0000 Received: (qmail 23108 invoked by uid 22791); 26 Dec 2006 05:51:55 -0000 X-Spam-Check-By: sourceware.org Received: from nile.gnat.com (HELO nile.gnat.com) (205.232.38.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 26 Dec 2006 05:51:49 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-nile.gnat.com (Postfix) with ESMTP id CC46248CC10 for ; Tue, 26 Dec 2006 00:51:47 -0500 (EST) Received: from nile.gnat.com ([127.0.0.1]) by localhost (nile.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 12244-01-8 for ; Tue, 26 Dec 2006 00:51:47 -0500 (EST) Received: from takamaka.act-europe.fr (AStDenis-105-1-9-113.w81-248.abo.wanadoo.fr [81.248.210.113]) by nile.gnat.com (Postfix) with ESMTP id CC8F548CBC5 for ; Tue, 26 Dec 2006 00:51:45 -0500 (EST) Received: by takamaka.act-europe.fr (Postfix, from userid 1000) id C09F334C099; Tue, 26 Dec 2006 09:52:33 +0400 (RET) Date: Tue, 26 Dec 2006 05:51:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFA/testsuite/ada] Add test with function returning "small" array of floats Message-ID: <20061226055233.GK3640@adacore.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="qGV0fN9tzfkG3CxV" Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-12/txt/msg00318.txt.bz2 --qGV0fN9tzfkG3CxV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 774 Hello, Following a question raised by Mark in: http://www.sourceware.org/ml/gdb-patches/2006-12/msg00312.html I decided to add a test in gdb.ada/array_return to cover that case. 2006-12-26 Joel Brobecker * gdb.ada/array_return/pck.ads (Small_Float_Vector): New type. (Create_Small_Float_Vector): New function. * gdb.ada/array_return/pck.adb (Create_Small_Float_Vector): Add function body. * gdb.ada/array_return/p.adb: Use new type and function from package Pck. * gdb.ada/array_return.exp: Add a test verifying that GDB is able to print the value returned by a function returning an array of float. Tested on sparc64-solaris. OK to apply? Thank you, -- Joel --qGV0fN9tzfkG3CxV Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="float-array-return.diff" Content-length: 3778 Index: array_return/pck.ads =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/array_return/pck.ads,v retrieving revision 1.2 diff -u -p -r1.2 pck.ads --- array_return/pck.ads 6 Oct 2006 18:05:58 -0000 1.2 +++ array_return/pck.ads 26 Dec 2006 05:32:06 -0000 @@ -20,8 +20,11 @@ package Pck is type Data_Small is array (1 .. 2) of Integer; type Data_Large is array (1 .. 4) of Integer; + type Small_Float_Vector is array (1 .. 2) of Float; + function Create_Small return Data_Small; function Create_Large return Data_Large; + function Create_Small_Float_Vector return Small_Float_Vector; end Pck; Index: array_return/pck.adb =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/array_return/pck.adb,v retrieving revision 1.2 diff -u -p -r1.2 pck.adb --- array_return/pck.adb 6 Oct 2006 18:05:58 -0000 1.2 +++ array_return/pck.adb 26 Dec 2006 05:32:06 -0000 @@ -27,4 +27,9 @@ package body Pck is return (others => 2); end Create_Large; + function Create_Small_Float_Vector return Small_Float_Vector is + begin + return (others => 4.25); + end Create_Small_Float_Vector; + end Pck; Index: array_return/p.adb =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/array_return/p.adb,v retrieving revision 1.2 diff -u -p -r1.2 p.adb --- array_return/p.adb 6 Oct 2006 18:05:58 -0000 1.2 +++ array_return/p.adb 26 Dec 2006 05:32:06 -0000 @@ -20,8 +20,11 @@ with Pck; use Pck; procedure P is Small : Data_Small; Large : Data_Large; + Vector : Small_Float_Vector; begin Small := Create_Small; Large := Create_Large; + Vector := Create_Small_Float_Vector; Small (1) := Large (1); + Small (2) := Integer (Vector (1)); end P; Index: array_return.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/array_return.exp,v retrieving revision 1.2 diff -u -p -r1.2 array_return.exp --- array_return.exp 7 Feb 2006 19:37:46 -0000 1.2 +++ array_return.exp 26 Dec 2006 05:32:06 -0000 @@ -54,12 +54,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 +74,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 +88,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" + --qGV0fN9tzfkG3CxV--