From: Thiago Jung Bauermann <bauerman@br.ibm.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: brobecker@adacore.com, luisgpm@linux.vnet.ibm.com,
drow@false.org, gdb-patches@sourceware.org
Subject: Re: [RFC] Linux-specific ppc32 ABI
Date: Wed, 06 Feb 2008 03:57:00 -0000 [thread overview]
Message-ID: <1202270167.21596.23.camel@localhost.localdomain> (raw)
In-Reply-To: <200802020008.m1208k7N002182@brahms.sibelius.xs4all.nl>
[-- Attachment #1: Type: text/plain, Size: 224 bytes --]
On Sat, 2008-02-02 at 01:08 +0100, Mark Kettenis wrote:
> Thiago/Luis, can you commit the testsuite change?
Sure. I committed the attached patch.
--
[]'s
Thiago Jung Bauermann
Software Engineer
IBM Linux Technology Center
[-- Attachment #2: ppc32-float-abi-testcases.diff --]
[-- Type: text/x-patch, Size: 6316 bytes --]
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v
retrieving revision 1.1567
diff -u -r1.1567 ChangeLog
--- ChangeLog 5 Feb 2008 22:20:51 -0000 1.1567
+++ ChangeLog 6 Feb 2008 03:52:41 -0000
@@ -1,3 +1,10 @@
+2008-02-06 Thiago Jung Bauermann <bauerman@br.ibm.com>
+
+ * gdb.base/callfuncs.c (t_float_many_args): New function.
+ (t_double_many_args): New function.
+ * gdb.base/callfuncs.exp: Add tests for exceeding float
+ and double parameters passed through the stack.
+
2008-02-05 Joel Brobecker <brobecker@adacore.com>
* gdb.ada/complete/pck.ads, gdb.ada/complete/pck.adb,
Index: gdb.base/callfuncs.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/callfuncs.c,v
retrieving revision 1.10
diff -u -r1.10 callfuncs.c
--- gdb.base/callfuncs.c 1 Jan 2008 22:53:18 -0000 1.10
+++ gdb.base/callfuncs.c 6 Feb 2008 03:52:41 -0000
@@ -46,9 +46,35 @@
float float_val1 = 3.14159;
float float_val2 = -2.3765;
+float float_val3 = 0.25;
+float float_val4 = 1.25;
+float float_val5 = 2.25;
+float float_val6 = 3.25;
+float float_val7 = 4.25;
+float float_val8 = 5.25;
+float float_val9 = 6.25;
+float float_val10 = 7.25;
+float float_val11 = 8.25;
+float float_val12 = 9.25;
+float float_val13 = 10.25;
+float float_val14 = 11.25;
+float float_val15 = 12.25;
double double_val1 = 45.654;
double double_val2 = -67.66;
+double double_val3 = 0.25;
+double double_val4 = 1.25;
+double double_val5 = 2.25;
+double double_val6 = 3.25;
+double double_val7 = 4.25;
+double double_val8 = 5.25;
+double double_val9 = 6.25;
+double double_val10 = 7.25;
+double double_val11 = 8.25;
+double double_val12 = 9.25;
+double double_val13 = 10.25;
+double double_val14 = 11.25;
+double double_val15 = 12.25;
#define DELTA (0.001)
@@ -298,6 +324,39 @@
&& (float_arg2 - float_val2) > -DELTA);
}
+/* This function has many arguments to force some of them to be passed via
+ the stack instead of registers, to test that GDB can construct correctly
+ the parameter save area. Note that Linux/ppc32 has 8 float registers to use
+ for float parameter passing and Linux/ppc64 has 13, so the number of
+ arguments has to be at least 14 to contemplate these platforms. */
+
+float
+#ifdef NO_PROTOTYPES
+t_float_many_args (f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13,
+ f14, f15)
+ float f1, float f2, float f3, float f4, float f5, float f6, float f7,
+ float f8, float f9, float f10, float f11, float f12, float f13, float f14,
+ float f15;
+#else
+t_float_many_args (float f1, float f2, float f3, float f4, float f5, float f6,
+ float f7, float f8, float f9, float f10, float f11,
+ float f12, float f13, float f14, float f15)
+#endif
+{
+ float sum_args;
+ float sum_values;
+
+ sum_args = f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12
+ + f13 + f14 + f15;
+ sum_values = float_val1 + float_val2 + float_val3 + float_val4 + float_val5
+ + float_val6 + float_val7 + float_val8 + float_val9
+ + float_val10 + float_val11 + float_val12 + float_val13
+ + float_val14 + float_val15;
+
+ return ((sum_args - sum_values) < DELTA
+ && (sum_args - sum_values) > -DELTA);
+}
+
#ifdef PROTOTYPES
int t_double_values (double double_arg1, double double_arg2)
#else
@@ -311,6 +370,39 @@
&& (double_arg2 - double_val2) > -DELTA);
}
+/* This function has many arguments to force some of them to be passed via
+ the stack instead of registers, to test that GDB can construct correctly
+ the parameter save area. Note that Linux/ppc32 has 8 float registers to use
+ for float parameter passing and Linux/ppc64 has 13, so the number of
+ arguments has to be at least 14 to contemplate these platforms. */
+
+double
+#ifdef NO_PROTOTYPES
+t_double_many_args (f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13,
+ f14, f15)
+ double f1, double f2, double f3, double f4, double f5, double f6,
+ double f7, double f8, double f9, double f10, double f11, double f12,
+ double f13, double f14, double f15;
+#else
+t_double_many_args (double f1, double f2, double f3, double f4, double f5,
+ double f6, double f7, double f8, double f9, double f10,
+ double f11, double f12, double f13, double f14, double f15)
+#endif
+{
+ double sum_args;
+ double sum_values;
+
+ sum_args = f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12
+ + f13 + f14 + f15;
+ sum_values = double_val1 + double_val2 + double_val3 + double_val4
+ + double_val5 + double_val6 + double_val7 + double_val8
+ + double_val9 + double_val10 + double_val11 + double_val12
+ + double_val13 + double_val14 + double_val15;
+
+ return ((sum_args - sum_values) < DELTA
+ && (sum_args - sum_values) > -DELTA);
+}
+
#ifdef PROTOTYPES
int t_string_values (char *string_arg1, char *string_arg2)
#else
Index: gdb.base/callfuncs.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/callfuncs.exp,v
retrieving revision 1.23
diff -u -r1.23 callfuncs.exp
--- gdb.base/callfuncs.exp 1 Jan 2008 22:53:18 -0000 1.23
+++ gdb.base/callfuncs.exp 6 Feb 2008 03:52:41 -0000
@@ -155,6 +155,8 @@
gdb_test "p t_float_values2(3.14159,float_val2)" " = 1"
+ gdb_test "p t_float_many_args (float_val1, float_val2, float_val3, float_val4, float_val5, float_val6, float_val7, float_val8, float_val9, float_val10, float_val11, float_val12, float_val13, float_val14, float_val15)" " = 1" "Call function with many float arguments."
+
gdb_test "p t_small_values(1,2,3,4,5,6,7,8,9,10)" " = 55"
gdb_test "p t_double_values(0.0,0.0)" " = 0"
@@ -163,6 +165,8 @@
gdb_test "p t_double_values(45.654,double_val2)" " = 1"
gdb_test "p t_double_values(double_val1,-67.66)" " = 1"
+ gdb_test "p t_double_many_args (double_val1, double_val2, double_val3, double_val4, double_val5, double_val6, double_val7, double_val8, double_val9, double_val10, double_val11, double_val12, double_val13, double_val14, double_val15)" " = 1" "Call function with many double arguments."
+
gdb_test "p t_double_int(99.0, 1)" " = 0"
gdb_test "p t_double_int(99.0, 99)" " = 1"
gdb_test "p t_int_double(99, 1.0)" " = 0"
prev parent reply other threads:[~2008-02-06 3:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-10 19:00 Luis Machado
2008-01-10 19:13 ` Daniel Jacobowitz
2008-01-10 19:26 ` Thiago Jung Bauermann
2008-01-11 6:06 ` Joel Brobecker
2008-01-11 15:55 ` Luis Machado
2008-01-11 15:58 ` Daniel Jacobowitz
2008-01-11 21:26 ` Luis Machado
2008-01-25 16:13 ` Thiago Jung Bauermann
2008-01-25 16:51 ` Thiago Jung Bauermann
2008-01-26 18:18 ` Mark Kettenis
2008-01-26 19:08 ` Joseph S. Myers
2008-01-26 19:10 ` Mark Kettenis
2008-01-28 20:32 ` Thiago Jung Bauermann
2008-02-01 21:42 ` Thiago Jung Bauermann
2008-02-01 22:39 ` Joel Brobecker
2008-02-02 0:27 ` Mark Kettenis
2008-02-06 3:57 ` Thiago Jung Bauermann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1202270167.21596.23.camel@localhost.localdomain \
--to=bauerman@br.ibm.com \
--cc=brobecker@adacore.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=luisgpm@linux.vnet.ibm.com \
--cc=mark.kettenis@xs4all.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox