This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[commited patch] libffi testsuite cleanup
- From: Andreas Tobler <toa at pop dot agri dot ch>
- To: Java Patches <java-patches at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 05 Sep 2004 00:43:01 +0200
- Subject: [commited patch] libffi testsuite cleanup
commited to main.
Regards,
Andreas
2004-09-05 Andreas Tobler <a.tobler@schweiz.ch>
* testsuite/libffi.call/many_win32.c: Remove whitespaces.
* testsuite/libffi.call/promotion.c: Likewise.
* testsuite/libffi.call/return_ll.c: Remove unused var. Cleanup
whitespaces.
* testsuite/libffi.call/return_sc.c: Likewise.
* testsuite/libffi.call/return_uc.c: Likewise.
Index: testsuite/libffi.call/return_ll.c
===================================================================
RCS file: /cvs/gcc/gcc/libffi/testsuite/libffi.call/return_ll.c,v
retrieving revision 1.1
diff -u -r1.1 return_ll.c
--- testsuite/libffi.call/return_ll.c 4 Sep 2003 14:47:48 -0000 1.1
+++ testsuite/libffi.call/return_ll.c 4 Sep 2004 22:31:50 -0000
@@ -18,26 +18,22 @@
void *values[MAX_ARGS];
long long rlonglong;
long long ll;
- unsigned long ul;
-
-
+
args[0] = &ffi_type_sint64;
values[0] = ≪
-
+
/* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
&ffi_type_sint64, args) == FFI_OK);
-
+
for (ll = 0LL; ll < 100LL; ll++)
{
- ul++;
ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values);
CHECK(rlonglong == ll);
}
-
+
for (ll = 55555555555000LL; ll < 55555555555100LL; ll++)
{
- ul++;
ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values);
CHECK(rlonglong == ll);
}
Index: testsuite/libffi.call/return_sc.c
===================================================================
RCS file: /cvs/gcc/gcc/libffi/testsuite/libffi.call/return_sc.c,v
retrieving revision 1.2
diff -u -r1.2 return_sc.c
--- testsuite/libffi.call/return_sc.c 8 Nov 2003 18:32:16 -0000 1.2
+++ testsuite/libffi.call/return_sc.c 4 Sep 2004 22:31:50 -0000
@@ -18,7 +18,6 @@
void *values[MAX_ARGS];
ffi_arg rint;
signed char sc;
- unsigned long ul;
args[0] = &ffi_type_schar;
values[0] = ≻
@@ -30,7 +29,6 @@
for (sc = (signed char) -127;
sc < (signed char) 127; sc++)
{
- ul++;
ffi_call(&cif, FFI_FN(return_sc), &rint, values);
CHECK(rint == (ffi_arg) sc);
}
Index: testsuite/libffi.call/return_uc.c
===================================================================
RCS file: /cvs/gcc/gcc/libffi/testsuite/libffi.call/return_uc.c,v
retrieving revision 1.1
diff -u -r1.1 return_uc.c
--- testsuite/libffi.call/return_uc.c 4 Sep 2003 14:47:48 -0000 1.1
+++ testsuite/libffi.call/return_uc.c 4 Sep 2004 22:31:50 -0000
@@ -20,19 +20,17 @@
ffi_arg rint;
unsigned char uc;
- unsigned long ul;
args[0] = &ffi_type_uchar;
values[0] = &uc;
-
+
/* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
&ffi_type_uchar, args) == FFI_OK);
-
- for (uc = (unsigned char) '\x00';
+
+ for (uc = (unsigned char) '\x00';
uc < (unsigned char) '\xff'; uc++)
{
- ul++;
ffi_call(&cif, FFI_FN(return_uc), &rint, values);
CHECK(rint == (signed int) uc);
}
Index: testsuite/libffi.call/many_win32.c
===================================================================
RCS file: /cvs/gcc/gcc/libffi/testsuite/libffi.call/many_win32.c,v
retrieving revision 1.2
diff -u -r1.2 many_win32.c
--- testsuite/libffi.call/many_win32.c 4 Dec 2003 17:51:17 -0000 1.2
+++ testsuite/libffi.call/many_win32.c 4 Sep 2004 22:31:50 -0000
@@ -26,7 +26,7 @@
return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13);
}
-int main (void)
+int main (void)
{
ffi_cif cif;
ffi_type *args[13];
@@ -34,30 +34,30 @@
float fa[13];
float f, ff;
unsigned long ul;
-
+
for (ul = 0; ul < 13; ul++)
{
args[ul] = &ffi_type_float;
values[ul] = &fa[ul];
fa[ul] = (float) ul;
}
-
+
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 13,
&ffi_type_float, args) == FFI_OK);
-
- ff = stdcall_many(fa[0], fa[1],
- fa[2], fa[3],
- fa[4], fa[5],
+
+ ff = stdcall_many(fa[0], fa[1],
+ fa[2], fa[3],
+ fa[4], fa[5],
fa[6], fa[7],
- fa[8], fa[9],
+ fa[8], fa[9],
fa[10], fa[11], fa[12]);
ffi_call(&cif, FFI_FN(stdcall_many), &f, values);
-
+
if (f - ff < FLT_EPSILON)
printf("stdcall many arg tests ok!\n");
else
- CHECK(0);
- exit(0);
+ CHECK(0);
+ exit(0);
}
Index: testsuite/libffi.call/promotion.c
===================================================================
RCS file: /cvs/gcc/gcc/libffi/testsuite/libffi.call/promotion.c,v
retrieving revision 1.1
diff -u -r1.1 promotion.c
--- testsuite/libffi.call/promotion.c 4 Sep 2003 14:47:48 -0000 1.1
+++ testsuite/libffi.call/promotion.c 4 Sep 2004 22:31:50 -0000
@@ -6,7 +6,7 @@
/* { dg-do run } */
#include "ffitest.h"
-static int promotion(signed char sc, signed short ss,
+static int promotion(signed char sc, signed short ss,
unsigned char uc, unsigned short us)
{
int r = (int) sc + (int) ss + (int) uc + (int) us;
@@ -34,18 +34,18 @@
values[1] = &ss;
values[2] = &uc;
values[3] = &us;
-
+
/* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
&ffi_type_sint, args) == FFI_OK);
-
+
us = 0;
ul = 0;
-
- for (sc = (signed char) -127;
+
+ for (sc = (signed char) -127;
sc <= (signed char) 120; /*@-type@*/ sc += 1 /*@=type@*/)
for (ss = -30000; ss <= 30000; ss += 10000)
- for (uc = (unsigned char) 0;
+ for (uc = (unsigned char) 0;
uc <= (unsigned char) 200; /*@-type@*/ uc += 20 /*@=type@*/)
for (us = 0; us <= 60000; us += 10000)
{
@@ -55,5 +55,5 @@
(unsigned char) uc + (unsigned short) us);
}
printf("%lu promotion tests run\n", ul);
- exit(0);
+ exit(0);
}