diff options
author | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-24 07:13:17 +0000 |
---|---|---|
committer | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-24 07:13:17 +0000 |
commit | 7fed151e92675001c8a21acf5adbfc9516c0f729 (patch) | |
tree | a8035e754dff36a8bb9039fcf3d32243a9642617 /libffi | |
parent | f5bcb691c220a0d3f750a2bba07cc54f2d01599d (diff) | |
download | gcc-7fed151e92675001c8a21acf5adbfc9516c0f729.tar.gz |
* testsuite/libffi.call/return_fl2.c (return_fl): Mark as static.
Use 'volatile float sum' to create sum of floats to avoid false
negative due to excess precision on ix86 targets.
(main): Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123180 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libffi')
-rw-r--r-- | libffi/ChangeLog | 7 | ||||
-rw-r--r-- | libffi/testsuite/libffi.call/return_fl2.c | 16 |
2 files changed, 17 insertions, 6 deletions
diff --git a/libffi/ChangeLog b/libffi/ChangeLog index ecd75cf978a..23ae5f80a16 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,10 @@ +2007-03-24 Uros Bizjak <ubizjak@gmail.com> + + * testsuite/libffi.call/return_fl2.c (return_fl): Mark as static. + Use 'volatile float sum' to create sum of floats to avoid false + negative due to excess precision on ix86 targets. + (main): Ditto. + 2007-03-08 Alexandre Oliva <aoliva@redhat.com> * src/powerpc/ffi.c (flush_icache): Fix left-over from previous diff --git a/libffi/testsuite/libffi.call/return_fl2.c b/libffi/testsuite/libffi.call/return_fl2.c index 6df5b540985..ddb976cc2bb 100644 --- a/libffi/testsuite/libffi.call/return_fl2.c +++ b/libffi/testsuite/libffi.call/return_fl2.c @@ -7,12 +7,13 @@ /* { dg-do run } */ #include "ffitest.h" -/* To avoid a false negative on ix86 do not declare the return_fl static. - See PR323. -*/ -float return_fl(float fl1, float fl2, float fl3, float fl4) +/* Use volatile float to avoid false negative on ix86. See PR target/323. */ +static float return_fl(float fl1, float fl2, float fl3, float fl4) { - return fl1 + fl2 + fl3 + fl4; + volatile float sum; + + sum = fl1 + fl2 + fl3 + fl4; + return sum; } int main (void) { @@ -20,6 +21,7 @@ int main (void) ffi_type *args[MAX_ARGS]; void *values[MAX_ARGS]; float fl1, fl2, fl3, fl4, rfl; + volatile float sum; args[0] = &ffi_type_float; args[1] = &ffi_type_float; @@ -40,6 +42,8 @@ int main (void) ffi_call(&cif, FFI_FN(return_fl), &rfl, values); printf ("%f vs %f\n", rfl, return_fl(fl1, fl2, fl3, fl4)); - CHECK(rfl == fl1 + fl2 + fl3 + fl4); + + sum = fl1 + fl2 + fl3 + fl4; + CHECK(rfl == sum); exit(0); } |