Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/c-c++-common/dfp/compare-rel-dfp.c @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* { dg-options "-O0" } */ /* C99 6.5.8 Relational 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) != 0) FAILURE if ((d64 <= d128) != 1) FAILURE if ((d128 > d32) != 1) FAILURE if ((d128 >= d64) != 1) FAILURE } int main () { inits (); compare_dfp (); FINISH }