2 /* { dg-options "-std=gnu99 -O0" } */
4 /* N1150 5.4: Usual arithmetic conversions.
7 Test arithmetic operators with different decimal float types, and
8 between decimal float types and integer types. */
10 extern void abort (void);
11 static int failcnt = 0;
13 /* Support compiling the test to report individual failures; default is
14 to abort as soon as a check fails. */
17 #define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; }
19 #define FAILURE abort ();
22 volatile _Decimal32 d32a, d32b, d32c;
23 volatile _Decimal64 d64a, d64b, d64c;
24 volatile _Decimal128 d128a, d128b, d128c;
31 d64b = 12.3456789012345e383dd;
32 d128b = 12345.6789012345678901e4000dl;
46 /* Usual arithmetic conversions between decimal float types; addition. */
66 /* Usual arithmetic conversions between decimal float types;
87 /* Usual arithmetic conversions between decimal float and integer types. */
89 if (d32a != d32c + 2.0df)
92 if (d32a != d32c - 2.0df)
95 if (d32a != d32c + d32c)
98 if (d32a != d32c / 2.0df)
102 if (d64a != d64c + 2.0dd)
105 if (d64a != d64c - 2.0dd)
108 if (d64a != d64c + d64c)
111 if (d64a != d64c / 2.0dd)
115 if (d128a != d128c + 2.0dl)
118 if (d128a != d128c - 2.0dl)
121 if (d128a != d128c + d128c)
124 if (d128a != d128c / 2.0dl)