* [Patch] libffi testsuite: Correct some type specifiers.
@ 2007-08-07 16:27 David Daney
2007-08-07 17:04 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: David Daney @ 2007-08-07 16:27 UTC (permalink / raw)
To: GCJ-patches, GCC Patches; +Cc: andreast
[-- Attachment #1: Type: text/plain, Size: 675 bytes --]
Whilst hacking things up to get MIPS64 working better in libffi, I came
across several test cases where structure elements were declared as type
'int' but the libffi type specifier identified them as uint32.
This patch corrects some (but probably not all) of these incongruities.
Tested on x86_64-pc-linux-gnu and Mips64-linux.
OK to commit?
2007-08-07 David Daney <ddaney@avtrex.com>
* testsuite/libffi.call/nested_struct.c (main): Use correct type
specifiers in structure specification.
* testsuite/libffi.call/cls_24byte.c (main): Ditto.
* testsuite/libffi.call/cls_12byte.c (main): Ditto.
* testsuite/libffi.call/cls_16byte.c (main): Ditto.
[-- Attachment #2: ffitypes.diff --]
[-- Type: text/x-patch, Size: 2521 bytes --]
Index: testsuite/libffi.call/nested_struct.c
===================================================================
--- testsuite/libffi.call/nested_struct.c (revision 127010)
+++ testsuite/libffi.call/nested_struct.c (working copy)
@@ -108,10 +108,10 @@ int main (void)
cls_struct_fields[0] = &ffi_type_double;
cls_struct_fields[1] = &ffi_type_float;
- cls_struct_fields[2] = &ffi_type_uint32;
+ cls_struct_fields[2] = &ffi_type_sint32;
cls_struct_fields[3] = NULL;
- cls_struct_fields1[0] = &ffi_type_uint32;
+ cls_struct_fields1[0] = &ffi_type_sint32;
cls_struct_fields1[1] = &ffi_type_double;
cls_struct_fields1[2] = &ffi_type_float;
cls_struct_fields1[3] = NULL;
Index: testsuite/libffi.call/cls_24byte.c
===================================================================
--- testsuite/libffi.call/cls_24byte.c (revision 127010)
+++ testsuite/libffi.call/cls_24byte.c (working copy)
@@ -82,7 +82,7 @@ int main (void)
cls_struct_fields[0] = &ffi_type_double;
cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_uint32;
+ cls_struct_fields[2] = &ffi_type_sint32;
cls_struct_fields[3] = &ffi_type_float;
cls_struct_fields[4] = NULL;
Index: testsuite/libffi.call/cls_12byte.c
===================================================================
--- testsuite/libffi.call/cls_12byte.c (revision 127010)
+++ testsuite/libffi.call/cls_12byte.c (working copy)
@@ -66,9 +66,9 @@ int main (void)
struct cls_struct_12byte j_dbl = { 1, 5, 3 };
struct cls_struct_12byte res_dbl;
- cls_struct_fields[0] = &ffi_type_uint32;
- cls_struct_fields[1] = &ffi_type_uint32;
- cls_struct_fields[2] = &ffi_type_uint32;
+ cls_struct_fields[0] = &ffi_type_sint32;
+ cls_struct_fields[1] = &ffi_type_sint32;
+ cls_struct_fields[2] = &ffi_type_sint32;
cls_struct_fields[3] = NULL;
dbl_arg_types[0] = &cls_struct_type;
Index: testsuite/libffi.call/cls_16byte.c
===================================================================
--- testsuite/libffi.call/cls_16byte.c (revision 127010)
+++ testsuite/libffi.call/cls_16byte.c (working copy)
@@ -67,9 +67,9 @@ int main (void)
struct cls_struct_16byte j_dbl = { 1, 9.0, 3 };
struct cls_struct_16byte res_dbl;
- cls_struct_fields[0] = &ffi_type_uint32;
+ cls_struct_fields[0] = &ffi_type_sint32;
cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_uint32;
+ cls_struct_fields[2] = &ffi_type_sint32;
cls_struct_fields[3] = NULL;
dbl_arg_types[0] = &cls_struct_type;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch] libffi testsuite: Correct some type specifiers.
2007-08-07 16:27 [Patch] libffi testsuite: Correct some type specifiers David Daney
@ 2007-08-07 17:04 ` Tom Tromey
2007-08-07 17:18 ` David Daney
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2007-08-07 17:04 UTC (permalink / raw)
To: David Daney; +Cc: GCJ-patches, GCC Patches, andreast
>>>>> "David" == David Daney <ddaney@avtrex.com> writes:
David> Whilst hacking things up to get MIPS64 working better in libffi, I
David> came across several test cases where structure elements were declared
David> as type 'int' but the libffi type specifier identified them as uint32.
David> This patch corrects some (but probably not all) of these incongruities.
I think a patch to fix a disparity like this would qualify as obvious.
However... if the struct definition says 'int', and the test case is
says ffi_type_sint32, then that seems like a bug in itself. There's
no guarantee that int == 32 bits. Wouldn't it be more correct to use
ffi_type_sint?
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch] libffi testsuite: Correct some type specifiers.
2007-08-07 17:04 ` Tom Tromey
@ 2007-08-07 17:18 ` David Daney
0 siblings, 0 replies; 3+ messages in thread
From: David Daney @ 2007-08-07 17:18 UTC (permalink / raw)
To: tromey; +Cc: GCJ-patches, GCC Patches, andreast
Tom Tromey wrote:
>>>>>> "David" == David Daney <ddaney@avtrex.com> writes:
>
> David> Whilst hacking things up to get MIPS64 working better in libffi, I
> David> came across several test cases where structure elements were declared
> David> as type 'int' but the libffi type specifier identified them as uint32.
>
> David> This patch corrects some (but probably not all) of these incongruities.
>
> I think a patch to fix a disparity like this would qualify as obvious.
>
> However... if the struct definition says 'int', and the test case is
> says ffi_type_sint32, then that seems like a bug in itself. There's
> no guarantee that int == 32 bits. Wouldn't it be more correct to use
> ffi_type_sint?
I thought of that after I sent the patch, and I agree. The problem is
pervasive in the testsuite. Patch withdrawn.
I will submit a revised patch soon.
David Daney
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-08-07 17:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-07 16:27 [Patch] libffi testsuite: Correct some type specifiers David Daney
2007-08-07 17:04 ` Tom Tromey
2007-08-07 17:18 ` David Daney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).