diff options
author | Andreas Tobler <a.tobler@schweiz.org> | 2007-11-16 23:24:53 +0000 |
---|---|---|
committer | Andreas Tobler <andreast@gcc.gnu.org> | 2007-11-17 00:24:53 +0100 |
commit | e84296c66c1d63552db6dd6571edd92619a00e53 (patch) | |
tree | bc0fd671d12c5cacb37413d21af623ab8d556f19 /libffi/testsuite | |
parent | f5fd0cf12def6df8ac3c6a95e886c73debc21677 (diff) | |
download | gcc-e84296c66c1d63552db6dd6571edd92619a00e53.zip gcc-e84296c66c1d63552db6dd6571edd92619a00e53.tar.gz gcc-e84296c66c1d63552db6dd6571edd92619a00e53.tar.bz2 |
sysv.S: Load correct cr to compare if we have long double.
2007-11-17 Andreas Tobler <a.tobler@schweiz.org>
* src/powerpc/sysv.S: Load correct cr to compare if we have long double.
* src/powerpc/linux64.S: Likewise.
* src/powerpc/ffi.c: Add a comment to show which part goes into cr6.
* testsuite/libffi.call/return_ldl.c: New test.
From-SVN: r130247
Diffstat (limited to 'libffi/testsuite')
-rw-r--r-- | libffi/testsuite/libffi.call/return_ldl.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/libffi/testsuite/libffi.call/return_ldl.c b/libffi/testsuite/libffi.call/return_ldl.c new file mode 100644 index 0000000..413bf94 --- /dev/null +++ b/libffi/testsuite/libffi.call/return_ldl.c @@ -0,0 +1,34 @@ +/* Area: ffi_call + Purpose: Check return value long double. + Limitations: none. + PR: none. + Originator: <andreast@gcc.gnu.org> 20071113 */ + +/* { dg-do run } */ +#include "ffitest.h" + +static long double return_ldl(long double ldl) +{ + return 2*ldl; +} +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + long double ldl, rldl; + + args[0] = &ffi_type_longdouble; + values[0] = &ldl; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_longdouble, args) == FFI_OK); + + for (ldl = -127.0; ldl < 127.0; ldl++) + { + ffi_call(&cif, FFI_FN(return_ldl), &rldl, values); + CHECK(rldl == 2 * ldl); + } + exit(0); +} |