Commit 4af66bb62fab9a8e318af3bf01e5486596a0c8d4

green 2001-10-21T19:18:42

Testsuite fixes.

diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 8f42ec0..f5b08fe 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,17 @@
+Sun Oct 21 12:15:17 2001  Anthony Green  <green@redhat.com>
+
+	* testsuite/lib/libffi.exp, testsuite/libffi.call/float.c,
+	testsuite/libffi.call/many.c, testsuite/libffi.call/strlen.c,
+	testsuite/libffi.call/ffitest.h, testsuite/libffi.call/call.exp,
+	testsuite/config/default.exp, testsuite/Makefile.am,
+	testsuite/Makefile.in: New files.
+	
+	* include/ffi.h: Remove /*@ comments.
+	(FFI_ALIGN_RVALUE): Define.
+
+	* Makefile.am (libffi_la_LDFLAGS): Remove -I$(srcdir)/src.
+	* Makefile.in: Rebuilt.
+
 Sun Apr 22 15:50:08 2001  Anthony Green  <green@redhat.com>
 
 	* include/ffi_common.h: Delete, after moving contents to...
diff --git a/libffi/Makefile.am b/libffi/Makefile.am
index f46f4c5..aeab336 100644
--- a/libffi/Makefile.am
+++ b/libffi/Makefile.am
@@ -43,4 +43,4 @@ AM_CFLAGS = -fexceptions
 
 libffi_la_LDFLAGS = -release $(VERSION) 
 
-INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
+INCLUDES = -I$(top_srcdir)/include -Iinclude
diff --git a/libffi/configure.in b/libffi/configure.in
index 1a1254b..a20c05b 100644
--- a/libffi/configure.in
+++ b/libffi/configure.in
@@ -27,7 +27,7 @@ AC_SUBST(libffi_basedir)
 
 AC_CANONICAL_HOST
 
-AM_INIT_AUTOMAKE(libffi,2.00-beta,no-define)
+AM_INIT_AUTOMAKE(libffi,2.00,no-define)
 
 AC_EXEEXT
 AM_MAINTAINER_MODE
diff --git a/libffi/include/ffi.h b/libffi/include/ffi.h
index 1ad4acf..b672db8 100644
--- a/libffi/include/ffi.h
+++ b/libffi/include/ffi.h
@@ -20,7 +20,6 @@
    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    OTHER DEALINGS IN THE SOFTWARE.
-
    ----------------------------------------------------------------------- */
 
 /* -------------------------------------------------------------------
@@ -234,10 +233,10 @@ typedef union {
   void*    ptr;
 } ffi_raw;
 
-void ffi_raw_call (/*@dependent@*/ ffi_cif *cif, 
+void ffi_raw_call (ffi_cif *cif, 
 		   void (*fn)(), 
-		   /*@out@*/ void *rvalue, 
-		   /*@dependent@*/ ffi_raw *avalue);
+		   void *rvalue, 
+		   ffi_raw *avalue);
 
 void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
 void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
@@ -249,10 +248,10 @@ size_t ffi_raw_size (ffi_cif *cif);
 /* packing, even on 64-bit machines.  I.e. on 64-bit machines		*/
 /* longs and doubles are followed by an empty 64-bit word.		*/
 
-void ffi_java_raw_call (/*@dependent@*/ ffi_cif *cif, 
+void ffi_java_raw_call (ffi_cif *cif, 
 		        void (*fn)(), 
-		        /*@out@*/ void *rvalue, 
-		        /*@dependent@*/ ffi_raw *avalue);
+		        void *rvalue, 
+		        ffi_raw *avalue);
 
 void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
 void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
@@ -262,6 +261,11 @@ size_t ffi_java_raw_size (ffi_cif *cif);
 
 #endif /* !FFI_NO_RAW_API */
 
+/* ---- Return type alignment -------------------------------------------- */
+
+/* This is more than enough for all supported architectures.  */
+#define FFI_ALIGN_RVALUE __attribute__((aligned(8)))
+
 /* ---- Definitions for closures ----------------------------------------- */
 
 #ifdef __i386__
diff --git a/libffi/testsuite/libffi.call/float.c b/libffi/testsuite/libffi.call/float.c
index 95e7a31..8b68a58 100644
--- a/libffi/testsuite/libffi.call/float.c
+++ b/libffi/testsuite/libffi.call/float.c
@@ -19,7 +19,7 @@ main ()
   float f;
   double d;
   long double ld;
-  int rint __attribute__((aligned(8)));
+  int rint FFI_ALIGN_RVALUE;
 
   args[0] = &ffi_type_sint;
   values[0] = &si1;
diff --git a/libffi/testsuite/libffi.call/many.c b/libffi/testsuite/libffi.call/many.c
index 1b3d72c..bd2d307 100644
--- a/libffi/testsuite/libffi.call/many.c
+++ b/libffi/testsuite/libffi.call/many.c
@@ -16,7 +16,7 @@ static float many(float f1,
 		  float f12,
 		  float f13)
 {
-#if 1
+#if 0
   printf("%f %f %f %f %f %f %f %f %f %f %f %f %f\n",
 	 (double) f1, (double) f2, (double) f3, (double) f4, (double) f5, 
 	 (double) f6, (double) f7, (double) f8, (double) f9, (double) f10,
diff --git a/libffi/testsuite/libffi.call/strlen.c b/libffi/testsuite/libffi.call/strlen.c
index 3517278..3b921ec 100644
--- a/libffi/testsuite/libffi.call/strlen.c
+++ b/libffi/testsuite/libffi.call/strlen.c
@@ -11,7 +11,7 @@ main ()
   ffi_cif cif;
   ffi_type *args[1];
   void *values[1];
-  int rint __attribute__((aligned(8)));
+  int rint FFI_ALIGN_RVALUE;
   char *s;
 
   args[0] = &ffi_type_pointer;
diff --git a/libffi/x86/ffi.c b/libffi/x86/ffi.c
index 830d6a1..b0d54a4 100644
--- a/libffi/x86/ffi.c
+++ b/libffi/x86/ffi.c
@@ -25,16 +25,13 @@
 
 #include <ffi.h>
 #include <ffi_private.h>
-#include <ffi_common.h>
 
 #include <stdlib.h>
 
 /* ffi_prep_args is called by the assembly routine once stack space
    has been allocated for the function's arguments */
 
-/*@-exportheader@*/
 void ffi_prep_args(char *stack, extended_cif *ecif)
-/*@=exportheader@*/
 {
   register unsigned int i;
   register int tmp;
@@ -145,20 +142,16 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
   return FFI_OK;
 }
 
-/*@-declundef@*/
-/*@-exportheader@*/
 extern void ffi_call_SYSV(void (*)(char *, extended_cif *), 
-			  /*@out@*/ extended_cif *, 
+			  extended_cif *, 
 			  unsigned, unsigned, 
-			  /*@out@*/ unsigned *, 
+			  unsigned *, 
 			  void (*fn)());
-/*@=declundef@*/
-/*@=exportheader@*/
 
-void ffi_call(/*@dependent@*/ ffi_cif *cif, 
+void ffi_call(ffi_cif *cif, 
 	      void (*fn)(), 
-	      /*@out@*/ void *rvalue, 
-	      /*@dependent@*/ void **avalue)
+	      void *rvalue, 
+	      void **avalue)
 {
   extended_cif ecif;
 
@@ -171,9 +164,7 @@ void ffi_call(/*@dependent@*/ ffi_cif *cif,
   if ((rvalue == NULL) && 
       (cif->rtype->type == FFI_TYPE_STRUCT))
     {
-      /*@-sysunrecog@*/
       ecif.rvalue = alloca(cif->rtype->size);
-      /*@=sysunrecog@*/
     }
   else
     ecif.rvalue = rvalue;
@@ -182,10 +173,8 @@ void ffi_call(/*@dependent@*/ ffi_cif *cif,
   switch (cif->abi) 
     {
     case FFI_SYSV:
-      /*@-usedef@*/
       ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, 
 		    cif->flags, ecif.rvalue, fn);
-      /*@=usedef@*/
       break;
     default:
       FFI_ASSERT(0);
@@ -266,11 +255,9 @@ ffi_closure_SYSV ()
     }
 }
 
-/*@-exportheader@*/
 static void 
 ffi_prep_incoming_args_SYSV(char *stack, void **rvalue,
 			    void **avalue, ffi_cif *cif)
-/*@=exportheader@*/
 {
   register unsigned int i;
   register int tmp;
@@ -461,16 +448,16 @@ ffi_prep_args_raw(char *stack, extended_cif *ecif)
 
 extern void 
 ffi_call_SYSV(void (*)(char *, extended_cif *), 
-	      /*@out@*/ extended_cif *, 
+	      extended_cif *, 
 	      unsigned, unsigned, 
-	      /*@out@*/ unsigned *, 
+	      unsigned *, 
 	      void (*fn)());
 
 void
-ffi_raw_call(/*@dependent@*/ ffi_cif *cif, 
+ffi_raw_call(ffi_cif *cif, 
 	     void (*fn)(), 
-	     /*@out@*/ void *rvalue, 
-	     /*@dependent@*/ ffi_raw *fake_avalue)
+	     void *rvalue, 
+	     ffi_raw *fake_avalue)
 {
   extended_cif ecif;
   void **avalue = (void **)fake_avalue;
@@ -484,9 +471,7 @@ ffi_raw_call(/*@dependent@*/ ffi_cif *cif,
   if ((rvalue == NULL) && 
       (cif->rtype->type == FFI_TYPE_STRUCT))
     {
-      /*@-sysunrecog@*/
       ecif.rvalue = alloca(cif->rtype->size);
-      /*@=sysunrecog@*/
     }
   else
     ecif.rvalue = rvalue;
@@ -495,10 +480,8 @@ ffi_raw_call(/*@dependent@*/ ffi_cif *cif,
   switch (cif->abi) 
     {
     case FFI_SYSV:
-      /*@-usedef@*/
       ffi_call_SYSV(ffi_prep_args_raw, &ecif, cif->bytes, 
 		    cif->flags, ecif.rvalue, fn);
-      /*@=usedef@*/
       break;
     default:
       FFI_ASSERT(0);