summaryrefslogtreecommitdiffstats
path: root/libffi/testsuite
diff options
context:
space:
mode:
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-09 03:39:48 +0000
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-09 03:39:48 +0000
commit0ad895fb32c2c5c5f2d8c146834d5ddee545839b (patch)
tree78ec388e24099521b55d6696a59a0863b43e0521 /libffi/testsuite
parent3acc77d9f46893fbef167a15f7cbee957ebb0d53 (diff)
downloadppe42-gcc-0ad895fb32c2c5c5f2d8c146834d5ddee545839b.tar.gz
ppe42-gcc-0ad895fb32c2c5c5f2d8c146834d5ddee545839b.zip
* src/powerpc/ffi.c (ffi_prep_args64): Correct long double handling.
(ffi_closure_helper_LINUX64): Fix typo. * testsuite/libffi.call/cls_align_longdouble.c: Pass -mlong-double-128 for powerpc64-*-*. * testsuite/libffi.call/float.c: Likewise. * testsuite/libffi.call/float2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77522 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libffi/testsuite')
-rw-r--r--libffi/testsuite/libffi.call/cls_align_longdouble.c2
-rw-r--r--libffi/testsuite/libffi.call/float.c17
-rw-r--r--libffi/testsuite/libffi.call/float2.c18
3 files changed, 20 insertions, 17 deletions
diff --git a/libffi/testsuite/libffi.call/cls_align_longdouble.c b/libffi/testsuite/libffi.call/cls_align_longdouble.c
index a4c33481c8a..aacfcbafd8c 100644
--- a/libffi/testsuite/libffi.call/cls_align_longdouble.c
+++ b/libffi/testsuite/libffi.call/cls_align_longdouble.c
@@ -5,6 +5,8 @@
Originator: <hos@tamanegi.org> 20031203 */
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+/* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
+
#include "ffitest.h"
typedef struct cls_struct_align {
diff --git a/libffi/testsuite/libffi.call/float.c b/libffi/testsuite/libffi.call/float.c
index e5ee05b1464..d712fb1021a 100644
--- a/libffi/testsuite/libffi.call/float.c
+++ b/libffi/testsuite/libffi.call/float.c
@@ -5,6 +5,8 @@
Originator: From the original ffitest.c */
/* { dg-do run } */
+/* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
+
#include "ffitest.h"
static int floating(int a, float b, double c, long double d, int e)
@@ -28,8 +30,6 @@ int main (void)
double d;
long double ld;
signed int si2;
-
-
args[0] = &ffi_type_sint;
values[0] = &si1;
@@ -41,7 +41,7 @@ int main (void)
values[3] = &ld;
args[4] = &ffi_type_sint;
values[4] = &si2;
-
+
/* Initialize the cif */
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 5,
&ffi_type_sint, args) == FFI_OK);
@@ -51,15 +51,14 @@ int main (void)
d = (double)1.0/(double)3.0;
ld = 2.71828182846L;
si2 = 10;
-
+
floating (si1, f, d, ld, si2);
-
+
ffi_call(&cif, FFI_FN(floating), &rint, values);
-
+
printf ("%d vs %d\n", (int)rint, floating (si1, f, d, ld, si2));
-
+
CHECK(rint == floating(si1, f, d, ld, si2));
-
+
exit (0);
}
-
diff --git a/libffi/testsuite/libffi.call/float2.c b/libffi/testsuite/libffi.call/float2.c
index 413521280a3..4de41d356c4 100644
--- a/libffi/testsuite/libffi.call/float2.c
+++ b/libffi/testsuite/libffi.call/float2.c
@@ -5,6 +5,8 @@
Originator: From the original ffitest.c */
/* { dg-do run } */
+/* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
+
#include "ffitest.h"
#include "float.h"
@@ -23,14 +25,14 @@ int main (void)
args[0] = &ffi_type_float;
values[0] = &f;
-
+
/* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
&ffi_type_longdouble, args) == FFI_OK);
-
+
f = 3.14159;
-
-#if 1
+
+#if 1
/* This is ifdef'd out for now. long double support under SunOS/gcc
is pretty much non-existent. You'll get the odd bus error in library
routines like printf(). */
@@ -38,14 +40,14 @@ int main (void)
#endif
ld = 666;
ffi_call(&cif, FFI_FN(ldblit), &ld, values);
-
-#if 1
+
+#if 1
/* This is ifdef'd out for now. long double support under SunOS/gcc
is pretty much non-existent. You'll get the odd bus error in library
routines like printf(). */
printf ("%Lf, %Lf, %Lf, %Lf\n", ld, ldblit(f), ld - ldblit(f), LDBL_EPSILON);
#endif
-
+
/* These are not always the same!! Check for a reasonable delta */
/*@-realcompare@*/
if (ld - ldblit(f) < LDBL_EPSILON)
OpenPOWER on IntegriCloud