diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/c-c++-common/dfp/compare-eq-dfp.c | |
download | cbb-gcc-4.6.4-upstream.tar.bz2 cbb-gcc-4.6.4-upstream.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/c-c++-common/dfp/compare-eq-dfp.c')
-rw-r--r-- | gcc/testsuite/c-c++-common/dfp/compare-eq-dfp.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/dfp/compare-eq-dfp.c b/gcc/testsuite/c-c++-common/dfp/compare-eq-dfp.c new file mode 100644 index 000000000..79a5691eb --- /dev/null +++ b/gcc/testsuite/c-c++-common/dfp/compare-eq-dfp.c @@ -0,0 +1,53 @@ +/* { dg-options "-O0" } */ + +/* C99 6.5.9 Equality operators. + Compare decimal float values against variables of different types. */ + +#include "dfp-dbg.h" + +_Decimal32 d32; +_Decimal64 d64; +_Decimal128 d128; + +/* Use some typedefs of decimal float types, too. */ +typedef _Decimal32 SDtype; +typedef _Decimal64 DDtype; +typedef _Decimal128 TDtype; + +SDtype d32b; +DDtype d64b; +TDtype d128b; + +void +inits (void) +{ + d32 = 1.0df; + d64 = 3.0dd; + d128 = 5.0dl; + d32b = -1.0df; + d64b = -4.0dd; + d128b = -6.0dl; +} + +void +compare_dfp (void) +{ + if ((d32 == d64) != 0) FAILURE + if ((d32 != d128b) != 1) FAILURE + + if ((d64 != d32) != 1) FAILURE + if ((d64 == d128) != 0) FAILURE + + if ((d128 != d32) != 1) FAILURE + if ((d128 == d64) != 0) FAILURE +} + +int +main () +{ + inits (); + + compare_dfp (); + + FINISH +} |