2017-12-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / c-c++-common / dfp / compare-eq-dfp.c
blob79a5691ebfc23da13e259e8de258e93858179ee1
1 /* { dg-options "-O0" } */
3 /* C99 6.5.9 Equality operators.
4 Compare decimal float values against variables of different types. */
6 #include "dfp-dbg.h"
8 _Decimal32 d32;
9 _Decimal64 d64;
10 _Decimal128 d128;
12 /* Use some typedefs of decimal float types, too. */
13 typedef _Decimal32 SDtype;
14 typedef _Decimal64 DDtype;
15 typedef _Decimal128 TDtype;
17 SDtype d32b;
18 DDtype d64b;
19 TDtype d128b;
21 void
22 inits (void)
24 d32 = 1.0df;
25 d64 = 3.0dd;
26 d128 = 5.0dl;
27 d32b = -1.0df;
28 d64b = -4.0dd;
29 d128b = -6.0dl;
32 void
33 compare_dfp (void)
35 if ((d32 == d64) != 0) FAILURE
36 if ((d32 != d128b) != 1) FAILURE
38 if ((d64 != d32) != 1) FAILURE
39 if ((d64 == d128) != 0) FAILURE
41 if ((d128 != d32) != 1) FAILURE
42 if ((d128 == d64) != 0) FAILURE
45 int
46 main ()
48 inits ();
50 compare_dfp ();
52 FINISH