* [Patch] libffi testsuite: Use correct type specifiers.
@ 2007-08-08 5:07 David Daney
2007-08-08 9:00 ` Andrew Haley
2007-08-08 18:06 ` Andreas Tobler
0 siblings, 2 replies; 5+ messages in thread
From: David Daney @ 2007-08-08 5:07 UTC (permalink / raw)
To: GCJ-patches, GCC Patches, andreast
[-- Attachment #1: Type: text/plain, Size: 2551 bytes --]
As noted in my previous message:
http://gcc.gnu.org/ml/java-patches/2007-q3/msg00126.html
The libffi testsuite has many places where the wrong type specifier is
used. This patch corrects all the erroneous specifiers that I could
find. Also there was a definition in ffitest.h for ffi_type_mylong that
exactly mirrored a standard type definition found in ffi.h, so I removed
it and used the correct standard specifier instead.
Tested on x86_64-pc-linux-gnu (both native and -m32 ABIs) and
mips64-linux with no failures.
OK to commit?
David Daney
2007-08-07 David Daney <ddaney@avtrex.com>
* testsuite/libffi.call/ffitest.h (ffi_type_mylong): Remove definition.
* testsuite/libffi.call/cls_align_uint16.c (main): Use correct type
specifiers.
* testsuite/libffi.call/nested_struct1.c (main): Ditto.
* testsuite/libffi.call/cls_sint.c (main): Ditto.
* testsuite/libffi.call/nested_struct9.c (main): Ditto.
* testsuite/libffi.call/cls_20byte1.c (main): Ditto.
* testsuite/libffi.call/cls_9byte1.c (main): Ditto.
* testsuite/libffi.call/closure_fn1.c (main): Ditto.
* testsuite/libffi.call/closure_fn3.c (main): Ditto.
* testsuite/libffi.call/return_dbl2.c (main): Ditto.
* testsuite/libffi.call/cls_sshort.c (main): Ditto.
* testsuite/libffi.call/return_fl3.c (main): Ditto.
* testsuite/libffi.call/closure_fn5.c (main): Ditto.
* testsuite/libffi.call/nested_struct.c (main): Ditto.
* testsuite/libffi.call/nested_struct10.c (main): Ditto.
* testsuite/libffi.call/return_ll1.c (main): Ditto.
* testsuite/libffi.call/cls_8byte.c (main): Ditto.
* testsuite/libffi.call/cls_align_uint32.c (main): Ditto.
* testsuite/libffi.call/cls_align_sint16.c (main): Ditto.
* testsuite/libffi.call/cls_20byte.c (main): Ditto.
* testsuite/libffi.call/nested_struct2.c (main): Ditto.
* testsuite/libffi.call/cls_24byte.c (main): Ditto.
* testsuite/libffi.call/nested_struct6.c (main): Ditto.
* testsuite/libffi.call/cls_uint.c (main): Ditto.
* testsuite/libffi.call/cls_12byte.c (main): Ditto.
* testsuite/libffi.call/cls_16byte.c (main): Ditto.
* testsuite/libffi.call/closure_fn0.c (main): Ditto.
* testsuite/libffi.call/cls_9byte2.c (main): Ditto.
* testsuite/libffi.call/closure_fn2.c (main): Ditto.
* testsuite/libffi.call/return_dbl1.c (main): Ditto.
* testsuite/libffi.call/closure_fn4.c (main): Ditto.
* testsuite/libffi.call/closure_fn6.c (main): Ditto.
* testsuite/libffi.call/cls_align_sint32.c (main): Ditto.
[-- Attachment #2: ffitypes.diff --]
[-- Type: text/x-patch, Size: 20665 bytes --]
Index: testsuite/libffi.call/cls_align_uint16.c
===================================================================
--- testsuite/libffi.call/cls_align_uint16.c (revision 127010)
+++ testsuite/libffi.call/cls_align_uint16.c (working copy)
@@ -68,7 +68,7 @@ int main (void)
struct cls_struct_align res_dbl;
cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uint16;
+ cls_struct_fields[1] = &ffi_type_ushort;
cls_struct_fields[2] = &ffi_type_uchar;
cls_struct_fields[3] = NULL;
Index: testsuite/libffi.call/nested_struct1.c
===================================================================
--- testsuite/libffi.call/nested_struct1.c (revision 127010)
+++ testsuite/libffi.call/nested_struct1.c (working copy)
@@ -113,10 +113,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_sint;
cls_struct_fields[3] = NULL;
- cls_struct_fields1[0] = &ffi_type_uint32;
+ cls_struct_fields1[0] = &ffi_type_sint;
cls_struct_fields1[1] = &ffi_type_double;
cls_struct_fields1[2] = &ffi_type_float;
cls_struct_fields1[3] = NULL;
Index: testsuite/libffi.call/cls_sint.c
===================================================================
--- testsuite/libffi.call/cls_sint.c (revision 127010)
+++ testsuite/libffi.call/cls_sint.c (working copy)
@@ -32,12 +32,12 @@ int main (void)
pcl = &cl;
#endif
- cl_arg_types[0] = &ffi_type_sint32;
+ cl_arg_types[0] = &ffi_type_sint;
cl_arg_types[1] = NULL;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sint32, cl_arg_types) == FFI_OK);
+ &ffi_type_sint, cl_arg_types) == FFI_OK);
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_sint_fn, NULL) == FFI_OK);
Index: testsuite/libffi.call/nested_struct9.c
===================================================================
--- testsuite/libffi.call/nested_struct9.c (revision 127010)
+++ testsuite/libffi.call/nested_struct9.c (working copy)
@@ -103,7 +103,7 @@ int main (void)
cls_struct_fields1[1] = &ffi_type_uchar;
cls_struct_fields1[2] = NULL;
- cls_struct_fields2[0] = &ffi_type_mylong;
+ cls_struct_fields2[0] = &ffi_type_ulong;
cls_struct_fields2[1] = &ffi_type_uchar;
cls_struct_fields2[2] = NULL;
Index: testsuite/libffi.call/cls_20byte1.c
===================================================================
--- testsuite/libffi.call/cls_20byte1.c (revision 127010)
+++ testsuite/libffi.call/cls_20byte1.c (working copy)
@@ -69,7 +69,7 @@ int main (void)
struct cls_struct_20byte f_dbl = { 4, 5.0, 7.0 };
struct cls_struct_20byte res_dbl;
- cls_struct_fields[0] = &ffi_type_uint32;
+ cls_struct_fields[0] = &ffi_type_sint;
cls_struct_fields[1] = &ffi_type_double;
cls_struct_fields[2] = &ffi_type_double;
cls_struct_fields[3] = NULL;
Index: testsuite/libffi.call/cls_9byte1.c
===================================================================
--- testsuite/libffi.call/cls_9byte1.c (revision 127010)
+++ testsuite/libffi.call/cls_9byte1.c (working copy)
@@ -67,7 +67,7 @@ int main (void)
struct cls_struct_9byte j_dbl = { 1, 9.0};
struct cls_struct_9byte res_dbl;
- cls_struct_fields[0] = &ffi_type_uint32;
+ cls_struct_fields[0] = &ffi_type_sint;
cls_struct_fields[1] = &ffi_type_double;
cls_struct_fields[2] = NULL;
Index: testsuite/libffi.call/closure_fn1.c
===================================================================
--- testsuite/libffi.call/closure_fn1.c (revision 127010)
+++ testsuite/libffi.call/closure_fn1.c (working copy)
@@ -61,15 +61,15 @@ int main (void)
cl_arg_types[4] = &ffi_type_sshort;
cl_arg_types[5] = &ffi_type_float;
cl_arg_types[6] = &ffi_type_float;
- cl_arg_types[7] = &ffi_type_uint;
+ cl_arg_types[7] = &ffi_type_sint;
cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_uint;
- cl_arg_types[10] = &ffi_type_uint;
+ cl_arg_types[9] = &ffi_type_sint;
+ cl_arg_types[10] = &ffi_type_sint;
cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_uint;
- cl_arg_types[13] = &ffi_type_uint;
- cl_arg_types[14] = &ffi_type_uint;
- cl_arg_types[15] = &ffi_type_uint;
+ cl_arg_types[12] = &ffi_type_sint;
+ cl_arg_types[13] = &ffi_type_sint;
+ cl_arg_types[14] = &ffi_type_sint;
+ cl_arg_types[15] = &ffi_type_sint;
cl_arg_types[16] = NULL;
/* Initialize the cif */
Index: testsuite/libffi.call/closure_fn3.c
===================================================================
--- testsuite/libffi.call/closure_fn3.c (revision 127010)
+++ testsuite/libffi.call/closure_fn3.c (working copy)
@@ -64,13 +64,13 @@ int main (void)
cl_arg_types[6] = &ffi_type_float;
cl_arg_types[7] = &ffi_type_float;
cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_uint;
+ cl_arg_types[9] = &ffi_type_sint;
cl_arg_types[10] = &ffi_type_float;
cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_uint;
+ cl_arg_types[12] = &ffi_type_sint;
cl_arg_types[13] = &ffi_type_float;
cl_arg_types[14] = &ffi_type_float;
- cl_arg_types[15] = &ffi_type_uint;
+ cl_arg_types[15] = &ffi_type_sint;
cl_arg_types[16] = NULL;
/* Initialize the cif */
Index: testsuite/libffi.call/return_dbl2.c
===================================================================
--- testsuite/libffi.call/return_dbl2.c (revision 127010)
+++ testsuite/libffi.call/return_dbl2.c (working copy)
@@ -20,7 +20,7 @@ int main (void)
unsigned int in3;
args[0] = &ffi_type_double;
args[1] = &ffi_type_double;
- args[2] = &ffi_type_uint32;
+ args[2] = &ffi_type_uint;
args[3] = &ffi_type_double;
values[0] = &dbl1;
values[1] = &dbl2;
Index: testsuite/libffi.call/cls_sshort.c
===================================================================
--- testsuite/libffi.call/cls_sshort.c (revision 127010)
+++ testsuite/libffi.call/cls_sshort.c (working copy)
@@ -32,12 +32,12 @@ int main (void)
pcl = &cl;
#endif
- cl_arg_types[0] = &ffi_type_sint16;
+ cl_arg_types[0] = &ffi_type_sshort;
cl_arg_types[1] = NULL;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sint16, cl_arg_types) == FFI_OK);
+ &ffi_type_sshort, cl_arg_types) == FFI_OK);
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_sshort_fn, NULL) == FFI_OK);
Index: testsuite/libffi.call/return_fl3.c
===================================================================
--- testsuite/libffi.call/return_fl3.c (revision 127010)
+++ testsuite/libffi.call/return_fl3.c (working copy)
@@ -20,7 +20,7 @@ int main (void)
unsigned int in3;
args[0] = &ffi_type_float;
args[1] = &ffi_type_float;
- args[2] = &ffi_type_uint32;
+ args[2] = &ffi_type_uint;
args[3] = &ffi_type_float;
values[0] = &fl1;
values[1] = &fl2;
Index: testsuite/libffi.call/closure_fn5.c
===================================================================
--- testsuite/libffi.call/closure_fn5.c (revision 127010)
+++ testsuite/libffi.call/closure_fn5.c (working copy)
@@ -74,11 +74,11 @@ int main (void)
for (i = 0; i < 10; i++) {
cl_arg_types[i] = &ffi_type_uint64;
}
- cl_arg_types[10] = &ffi_type_uint;
+ cl_arg_types[10] = &ffi_type_sint;
for (i = 11; i < 15; i++) {
cl_arg_types[i] = &ffi_type_uint64;
}
- cl_arg_types[15] = &ffi_type_uint;
+ cl_arg_types[15] = &ffi_type_sint;
cl_arg_types[16] = NULL;
/* Initialize the cif */
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_sint;
cls_struct_fields[3] = NULL;
- cls_struct_fields1[0] = &ffi_type_uint32;
+ cls_struct_fields1[0] = &ffi_type_sint;
cls_struct_fields1[1] = &ffi_type_double;
cls_struct_fields1[2] = &ffi_type_float;
cls_struct_fields1[3] = NULL;
Index: testsuite/libffi.call/nested_struct10.c
===================================================================
--- testsuite/libffi.call/nested_struct10.c (revision 127010)
+++ testsuite/libffi.call/nested_struct10.c (working copy)
@@ -102,7 +102,7 @@ int main (void)
cls_struct_fields1[0] = &ffi_type_uchar;
cls_struct_fields1[1] = &cls_struct_type;
- cls_struct_fields1[2] = &ffi_type_uint32;
+ cls_struct_fields1[2] = &ffi_type_uint;
cls_struct_fields1[3] = NULL;
cls_struct_fields2[0] = &ffi_type_uint64;
Index: testsuite/libffi.call/return_ll1.c
===================================================================
--- testsuite/libffi.call/return_ll1.c (revision 127010)
+++ testsuite/libffi.call/return_ll1.c (working copy)
@@ -20,9 +20,9 @@ int main (void)
long long ll1;
unsigned ll0, ll2;
- args[0] = &ffi_type_uint32;
+ args[0] = &ffi_type_sint;
args[1] = &ffi_type_sint64;
- args[2] = &ffi_type_uint32;
+ args[2] = &ffi_type_sint;
values[0] = &ll0;
values[1] = &ll1;
values[2] = &ll2;
Index: testsuite/libffi.call/cls_8byte.c
===================================================================
--- testsuite/libffi.call/cls_8byte.c (revision 127010)
+++ testsuite/libffi.call/cls_8byte.c (working copy)
@@ -66,7 +66,7 @@ int main (void)
struct cls_struct_8byte f_dbl = { 4, 5.0 };
struct cls_struct_8byte res_dbl;
- cls_struct_fields[0] = &ffi_type_uint32;
+ cls_struct_fields[0] = &ffi_type_sint;
cls_struct_fields[1] = &ffi_type_float;
cls_struct_fields[2] = NULL;
Index: testsuite/libffi.call/cls_align_uint32.c
===================================================================
--- testsuite/libffi.call/cls_align_uint32.c (revision 127010)
+++ testsuite/libffi.call/cls_align_uint32.c (working copy)
@@ -68,7 +68,7 @@ int main (void)
struct cls_struct_align res_dbl;
cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uint32;
+ cls_struct_fields[1] = &ffi_type_uint;
cls_struct_fields[2] = &ffi_type_uchar;
cls_struct_fields[3] = NULL;
Index: testsuite/libffi.call/cls_align_sint16.c
===================================================================
--- testsuite/libffi.call/cls_align_sint16.c (revision 127010)
+++ testsuite/libffi.call/cls_align_sint16.c (working copy)
@@ -68,7 +68,7 @@ int main (void)
struct cls_struct_align res_dbl;
cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_sint16;
+ cls_struct_fields[1] = &ffi_type_sshort;
cls_struct_fields[2] = &ffi_type_uchar;
cls_struct_fields[3] = NULL;
Index: testsuite/libffi.call/cls_20byte.c
===================================================================
--- testsuite/libffi.call/cls_20byte.c (revision 127010)
+++ testsuite/libffi.call/cls_20byte.c (working copy)
@@ -69,7 +69,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_sint;
cls_struct_fields[3] = NULL;
dbl_arg_types[0] = &cls_struct_type;
Index: testsuite/libffi.call/nested_struct2.c
===================================================================
--- testsuite/libffi.call/nested_struct2.c (revision 127010)
+++ testsuite/libffi.call/nested_struct2.c (working copy)
@@ -80,7 +80,7 @@ int main (void)
struct B res_dbl;
- cls_struct_fields[0] = &ffi_type_mylong;
+ cls_struct_fields[0] = &ffi_type_ulong;
cls_struct_fields[1] = &ffi_type_uchar;
cls_struct_fields[2] = 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_sint;
cls_struct_fields[3] = &ffi_type_float;
cls_struct_fields[4] = NULL;
Index: testsuite/libffi.call/nested_struct6.c
===================================================================
--- testsuite/libffi.call/nested_struct6.c (revision 127010)
+++ testsuite/libffi.call/nested_struct6.c (working copy)
@@ -103,7 +103,7 @@ int main (void)
cls_struct_fields1[1] = &ffi_type_uchar;
cls_struct_fields1[2] = NULL;
- cls_struct_fields2[0] = &ffi_type_mylong;
+ cls_struct_fields2[0] = &ffi_type_slong;
cls_struct_fields2[1] = &ffi_type_uchar;
cls_struct_fields2[2] = NULL;
Index: testsuite/libffi.call/cls_uint.c
===================================================================
--- testsuite/libffi.call/cls_uint.c (revision 127010)
+++ testsuite/libffi.call/cls_uint.c (working copy)
@@ -33,12 +33,12 @@ int main (void)
pcl = &cl;
#endif
- cl_arg_types[0] = &ffi_type_uint32;
+ cl_arg_types[0] = &ffi_type_uint;
cl_arg_types[1] = NULL;
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_uint32, cl_arg_types) == FFI_OK);
+ &ffi_type_uint, cl_arg_types) == FFI_OK);
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_uint_fn, NULL) == FFI_OK);
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_sint;
+ cls_struct_fields[1] = &ffi_type_sint;
+ cls_struct_fields[2] = &ffi_type_sint;
cls_struct_fields[3] = NULL;
dbl_arg_types[0] = &cls_struct_type;
Index: testsuite/libffi.call/ffitest.h
===================================================================
--- testsuite/libffi.call/ffitest.h (revision 127010)
+++ testsuite/libffi.call/ffitest.h (working copy)
@@ -9,17 +9,6 @@
#define CHECK(x) !(x) ? abort() : 0
-/* Define our own long for easier handling on multilib targets. */
-#if LONG_MAX == 2147483647
-#define ffi_type_mylong ffi_type_uint32
-#else
-#if LONG_MAX == 9223372036854775807
-#define ffi_type_mylong ffi_type_uint64
-#else
-#error "Error, size LONG not defined as expected"
-#endif
-#endif
-
/* Define __UNUSED__ that also other compilers than gcc can run the tests. */
#undef __UNUSED__
#if defined(__GNUC__)
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_sint;
cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_uint32;
+ cls_struct_fields[2] = &ffi_type_sint;
cls_struct_fields[3] = NULL;
dbl_arg_types[0] = &cls_struct_type;
Index: testsuite/libffi.call/closure_fn0.c
===================================================================
--- testsuite/libffi.call/closure_fn0.c (revision 127010)
+++ testsuite/libffi.call/closure_fn0.c (working copy)
@@ -63,21 +63,21 @@ int main (void)
#endif
cl_arg_types[0] = &ffi_type_uint64;
- cl_arg_types[1] = &ffi_type_uint;
+ cl_arg_types[1] = &ffi_type_sint;
cl_arg_types[2] = &ffi_type_uint64;
- cl_arg_types[3] = &ffi_type_uint;
+ cl_arg_types[3] = &ffi_type_sint;
cl_arg_types[4] = &ffi_type_sshort;
cl_arg_types[5] = &ffi_type_uint64;
- cl_arg_types[6] = &ffi_type_uint;
- cl_arg_types[7] = &ffi_type_uint;
+ cl_arg_types[6] = &ffi_type_sint;
+ cl_arg_types[7] = &ffi_type_sint;
cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_uint;
- cl_arg_types[10] = &ffi_type_uint;
+ cl_arg_types[9] = &ffi_type_sint;
+ cl_arg_types[10] = &ffi_type_sint;
cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_uint;
- cl_arg_types[13] = &ffi_type_uint;
- cl_arg_types[14] = &ffi_type_uint;
- cl_arg_types[15] = &ffi_type_uint;
+ cl_arg_types[12] = &ffi_type_sint;
+ cl_arg_types[13] = &ffi_type_sint;
+ cl_arg_types[14] = &ffi_type_sint;
+ cl_arg_types[15] = &ffi_type_sint;
cl_arg_types[16] = NULL;
/* Initialize the cif */
Index: testsuite/libffi.call/cls_9byte2.c
===================================================================
--- testsuite/libffi.call/cls_9byte2.c (revision 127010)
+++ testsuite/libffi.call/cls_9byte2.c (working copy)
@@ -68,7 +68,7 @@ int main (void)
struct cls_struct_9byte res_dbl;
cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_uint32;
+ cls_struct_fields[1] = &ffi_type_sint;
cls_struct_fields[2] = NULL;
dbl_arg_types[0] = &cls_struct_type;
Index: testsuite/libffi.call/closure_fn2.c
===================================================================
--- testsuite/libffi.call/closure_fn2.c (revision 127010)
+++ testsuite/libffi.call/closure_fn2.c (working copy)
@@ -61,15 +61,15 @@ int main (void)
cl_arg_types[4] = &ffi_type_sshort;
cl_arg_types[5] = &ffi_type_double;
cl_arg_types[6] = &ffi_type_double;
- cl_arg_types[7] = &ffi_type_uint;
+ cl_arg_types[7] = &ffi_type_sint;
cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_uint;
- cl_arg_types[10] = &ffi_type_uint;
+ cl_arg_types[9] = &ffi_type_sint;
+ cl_arg_types[10] = &ffi_type_sint;
cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_uint;
+ cl_arg_types[12] = &ffi_type_sint;
cl_arg_types[13] = &ffi_type_float;
- cl_arg_types[14] = &ffi_type_uint;
- cl_arg_types[15] = &ffi_type_uint;
+ cl_arg_types[14] = &ffi_type_sint;
+ cl_arg_types[15] = &ffi_type_sint;
cl_arg_types[16] = NULL;
/* Initialize the cif */
Index: testsuite/libffi.call/return_dbl1.c
===================================================================
--- testsuite/libffi.call/return_dbl1.c (revision 127010)
+++ testsuite/libffi.call/return_dbl1.c (working copy)
@@ -21,7 +21,7 @@ int main (void)
unsigned int in3;
args[0] = &ffi_type_double;
args[1] = &ffi_type_float;
- args[2] = &ffi_type_uint32;
+ args[2] = &ffi_type_uint;
args[3] = &ffi_type_double;
values[0] = &dbl1;
values[1] = &fl2;
Index: testsuite/libffi.call/closure_fn4.c
===================================================================
--- testsuite/libffi.call/closure_fn4.c (revision 127010)
+++ testsuite/libffi.call/closure_fn4.c (working copy)
@@ -76,7 +76,7 @@ int main (void)
for (i = 0; i < 15; i++) {
cl_arg_types[i] = &ffi_type_uint64;
}
- cl_arg_types[15] = &ffi_type_uint;
+ cl_arg_types[15] = &ffi_type_sint;
cl_arg_types[16] = NULL;
/* Initialize the cif */
Index: testsuite/libffi.call/closure_fn6.c
===================================================================
--- testsuite/libffi.call/closure_fn6.c (revision 127010)
+++ testsuite/libffi.call/closure_fn6.c (working copy)
@@ -67,16 +67,16 @@ int main (void)
cl_arg_types[1] = &ffi_type_uint64;
cl_arg_types[2] = &ffi_type_uint64;
cl_arg_types[3] = &ffi_type_uint64;
- cl_arg_types[4] = &ffi_type_uint;
+ cl_arg_types[4] = &ffi_type_sint;
cl_arg_types[5] = &ffi_type_double;
cl_arg_types[6] = &ffi_type_double;
cl_arg_types[7] = &ffi_type_float;
cl_arg_types[8] = &ffi_type_double;
cl_arg_types[9] = &ffi_type_double;
- cl_arg_types[10] = &ffi_type_uint;
+ cl_arg_types[10] = &ffi_type_sint;
cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_uint;
- cl_arg_types[13] = &ffi_type_uint;
+ cl_arg_types[12] = &ffi_type_sint;
+ cl_arg_types[13] = &ffi_type_sint;
cl_arg_types[14] = &ffi_type_double;
cl_arg_types[15] = &ffi_type_double;
cl_arg_types[16] = NULL;
Index: testsuite/libffi.call/cls_align_sint32.c
===================================================================
--- testsuite/libffi.call/cls_align_sint32.c (revision 127010)
+++ testsuite/libffi.call/cls_align_sint32.c (working copy)
@@ -68,7 +68,7 @@ int main (void)
struct cls_struct_align res_dbl;
cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_sint32;
+ cls_struct_fields[1] = &ffi_type_sint;
cls_struct_fields[2] = &ffi_type_uchar;
cls_struct_fields[3] = NULL;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Patch] libffi testsuite: Use correct type specifiers.
2007-08-08 5:07 [Patch] libffi testsuite: Use correct type specifiers David Daney
@ 2007-08-08 9:00 ` Andrew Haley
2007-08-08 15:19 ` David Daney
2007-08-08 18:06 ` Andreas Tobler
1 sibling, 1 reply; 5+ messages in thread
From: Andrew Haley @ 2007-08-08 9:00 UTC (permalink / raw)
To: David Daney; +Cc: GCJ-patches, GCC Patches, andreast
David Daney writes:
> As noted in my previous message:
> http://gcc.gnu.org/ml/java-patches/2007-q3/msg00126.html
>
> The libffi testsuite has many places where the wrong type specifier is
> used. This patch corrects all the erroneous specifiers that I could
> find. Also there was a definition in ffitest.h for ffi_type_mylong that
> exactly mirrored a standard type definition found in ffi.h, so I removed
> it and used the correct standard specifier instead.
>
> Tested on x86_64-pc-linux-gnu (both native and -m32 ABIs) and
> mips64-linux with no failures.
>
> OK to commit?
Some of these don't look right. For example, cls_align_sint32.c is
supposed to check structure alignment of sint32, but you changed it to
int. It would make more sense to change "signed int" to sint32_t,
wouldn't it? Then the test would actually be doing what it says it's
supposed to do.
Andrew.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Patch] libffi testsuite: Use correct type specifiers.
2007-08-08 9:00 ` Andrew Haley
@ 2007-08-08 15:19 ` David Daney
2007-08-08 15:28 ` Andrew Haley
0 siblings, 1 reply; 5+ messages in thread
From: David Daney @ 2007-08-08 15:19 UTC (permalink / raw)
To: Andrew Haley; +Cc: GCJ-patches, GCC Patches, andreast
Andrew Haley wrote:
> David Daney writes:
> > As noted in my previous message:
> > http://gcc.gnu.org/ml/java-patches/2007-q3/msg00126.html
> >
> > The libffi testsuite has many places where the wrong type specifier is
> > used. This patch corrects all the erroneous specifiers that I could
> > find. Also there was a definition in ffitest.h for ffi_type_mylong that
> > exactly mirrored a standard type definition found in ffi.h, so I removed
> > it and used the correct standard specifier instead.
> >
> > Tested on x86_64-pc-linux-gnu (both native and -m32 ABIs) and
> > mips64-linux with no failures.
> >
> > OK to commit?
>
> Some of these don't look right. For example, cls_align_sint32.c is
> supposed to check structure alignment of sint32, but you changed it to
> int.
No. Although its name would imply otherwise, that test checks the
alignment of *int* fields within structures. I didn't change that
fact. All I did was to make the libffi type specifiers accurately
reflect the types of the parameters and return values.
> It would make more sense to change "signed int" to sint32_t,
> wouldn't it? Then the test would actually be doing what it says it's
> supposed to do.
>
My understanding is that valid test cases should never be changed. If
one wants to test for something different, a new test case should be
written. The intent of my patch was to fix internal inconsistencies in
the test cases with out changing what they were testing for. I agree
that it would make sense to add tests that check passing of fixed width
integers, but that is not what this patch does.
David Daney
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Patch] libffi testsuite: Use correct type specifiers.
2007-08-08 15:19 ` David Daney
@ 2007-08-08 15:28 ` Andrew Haley
0 siblings, 0 replies; 5+ messages in thread
From: Andrew Haley @ 2007-08-08 15:28 UTC (permalink / raw)
To: David Daney; +Cc: GCJ-patches, GCC Patches, andreast
David Daney writes:
> Andrew Haley wrote:
> > David Daney writes:
> > > As noted in my previous message:
> > > http://gcc.gnu.org/ml/java-patches/2007-q3/msg00126.html
> > >
> > > The libffi testsuite has many places where the wrong type specifier is
> > > used. This patch corrects all the erroneous specifiers that I could
> > > find. Also there was a definition in ffitest.h for ffi_type_mylong that
> > > exactly mirrored a standard type definition found in ffi.h, so I removed
> > > it and used the correct standard specifier instead.
> > >
> > > Tested on x86_64-pc-linux-gnu (both native and -m32 ABIs) and
> > > mips64-linux with no failures.
> > >
> > > OK to commit?
> >
> > Some of these don't look right. For example, cls_align_sint32.c is
> > supposed to check structure alignment of sint32, but you changed it to
> > int.
> No. Although its name would imply otherwise, that test checks the
> alignment of *int* fields within structures. I didn't change that
> fact. All I did was to make the libffi type specifiers accurately
> reflect the types of the parameters and return values.
Fair enough.
Andrew.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Patch] libffi testsuite: Use correct type specifiers.
2007-08-08 5:07 [Patch] libffi testsuite: Use correct type specifiers David Daney
2007-08-08 9:00 ` Andrew Haley
@ 2007-08-08 18:06 ` Andreas Tobler
1 sibling, 0 replies; 5+ messages in thread
From: Andreas Tobler @ 2007-08-08 18:06 UTC (permalink / raw)
To: David Daney; +Cc: GCJ-patches, GCC Patches, andreast
David Daney wrote:
> As noted in my previous message:
> http://gcc.gnu.org/ml/java-patches/2007-q3/msg00126.html
>
> The libffi testsuite has many places where the wrong type specifier is
> used. This patch corrects all the erroneous specifiers that I could
> find. Also there was a definition in ffitest.h for ffi_type_mylong that
> exactly mirrored a standard type definition found in ffi.h, so I removed
> it and used the correct standard specifier instead.
Most of the test cases were born before the libffi reorg from Paolo B.
and rth came in, that was back in october 03. When I committed the test
cases I did not notice the double definition. Sorry.
> Tested on x86_64-pc-linux-gnu (both native and -m32 ABIs) and
> mips64-linux with no failures.
>
> OK to commit?
I think yes. Will see if there are fallouts on other platforms. And if
so you might have uncovered a bug there ;)
Thank you David!
Andreas
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-08-08 18:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-08 5:07 [Patch] libffi testsuite: Use correct type specifiers David Daney
2007-08-08 9:00 ` Andrew Haley
2007-08-08 15:19 ` David Daney
2007-08-08 15:28 ` Andrew Haley
2007-08-08 18:06 ` Andreas Tobler
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).