public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Haley <aph@redhat.com>
To: Anthony Green <green@redhat.com>
Cc: Anthony Green <green@moxielogic.com>, libffi-discuss@sourceware.org
Subject: Broken tests in libffi testsuite
Date: Fri, 15 Nov 2013 16:18:00 -0000	[thread overview]
Message-ID: <5286494E.9080707@redhat.com> (raw)
In-Reply-To: <1307910644.3010634.1381254018689.JavaMail.root@redhat.com>

Following our discussion about the fact that return values are
full-word-sized, here are some tests that were using libffi
incorrectly, and thus failing on (big-endian)
powerpc64-redhat-linux-gnu.

With these changes I get a clean test run.

Andrew.


2013-11-15    Andrew Haley <aph@redhat.com>

	* testsuite/libffi.call/va_struct1.c (main): Fix broken test.
	* testsuite/libffi.call/cls_uint_va.c (cls_ret_T_fn): Likewise
	* testsuite/libffi.call/cls_struct_va1.c (test_fn): Likewise.
	* testsuite/libffi.call/va_1.c (main): Likewise.

diff --git a/testsuite/libffi.call/cls_struct_va1.c b/testsuite/libffi.call/cls_struct_va1.c
index 175ed96..6d1fdae 100644
--- a/testsuite/libffi.call/cls_struct_va1.c
+++ b/testsuite/libffi.call/cls_struct_va1.c
@@ -35,7 +35,7 @@ test_fn (ffi_cif* cif __UNUSED__, void* resp,
   printf ("%d %d %d %d %d %d %d %d %d %d\n", n, s1.a, s1.b,
          l1.a, l1.b, l1.c, l1.d, l1.e,
          s2.a, s2.b);
-  * (int*) resp = 42;
+  * (ffi_arg*) resp = 42;
 }

 int
diff --git a/testsuite/libffi.call/cls_uint_va.c b/testsuite/libffi.call/cls_uint_va.c
index 150fddd..548d8c6 100644
--- a/testsuite/libffi.call/cls_uint_va.c
+++ b/testsuite/libffi.call/cls_uint_va.c
@@ -10,12 +10,13 @@

 typedef unsigned int T;

-static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
+static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void *resp, void** args,
                         void* userdata __UNUSED__)
  {
-   *(T *)resp = *(T *)args[0];
+   *(ffi_arg*)resp = *(T *)args[0];

-   printf("%d: %d %d\n", *(T *)resp, *(T *)args[0], *(T *)args[1]);
+
+   printf("%d: %d %d\n", (int)*(ffi_arg *)resp, *(T *)args[0], *(T *)args[1]);
  }

 typedef T (*cls_ret_T)(T, ...);
diff --git a/testsuite/libffi.call/va_1.c b/testsuite/libffi.call/va_1.c
index cf4dd85..7f96809 100644
--- a/testsuite/libffi.call/va_1.c
+++ b/testsuite/libffi.call/va_1.c
@@ -94,7 +94,7 @@ main (void)
   struct large_tag l1;

   int n;
-  int res;
+  ffi_arg res;

   unsigned char uc;
   signed char sc;
diff --git a/testsuite/libffi.call/va_struct1.c b/testsuite/libffi.call/va_struct1.c
index 11d1f10..e645206 100644
--- a/testsuite/libffi.call/va_struct1.c
+++ b/testsuite/libffi.call/va_struct1.c
@@ -61,7 +61,7 @@ main (void)
   struct large_tag l1;

   int n;
-  int res;
+  ffi_arg res;

   s_type.size = 0;
   s_type.alignment = 0;

  parent reply	other threads:[~2013-11-15 16:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-08 17:14 return value buffer malloc()'ed vs alloca()'ed Igor Bogomazov
2013-10-08 17:30 ` Anthony Green
2013-10-08 17:36   ` Andrew Haley
2013-10-08 17:40     ` Anthony Green
2013-10-08 17:45       ` Andrew Haley
2013-10-09  5:09         ` Igor Bogomazov
2013-11-15 16:18       ` Andrew Haley [this message]
2013-11-16 11:24         ` Broken tests in libffi testsuite Alan Modra
2013-10-08 17:33 ` return value buffer malloc()'ed vs alloca()'ed Andrew Haley

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=5286494E.9080707@redhat.com \
    --to=aph@redhat.com \
    --cc=green@moxielogic.com \
    --cc=green@redhat.com \
    --cc=libffi-discuss@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).