* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
[official-gcc.git] / gcc / testsuite / c-c++-common / dfp / operator-arith-fold.c
blobc4aa4cbb27edede313151f49591473e12108aac7
1 /* { dg-options "-O2" } */
3 /* C99 6.5.5: Multiplicative operators.
4 C99 6.5.6: Additive operators. */
6 #include "dfp-dbg.h"
8 extern void link_error (void);
10 int
11 main ()
13 _Decimal32 d32_1, d32_2;
15 /* Compare like-typed positive constants. */
16 if (2.99df + 5.1df != 8.09df)
17 link_error ();
19 if (5.77df - 2.22dd != 3.55df)
20 link_error ();
22 if (2.0dl * 3.7dd * -2 != -14.8df)
23 link_error ();
25 if (.18df / -.2df + 1 != 1.e-1dd)
26 link_error ();
28 d32_1 = 3.0df;
29 d32_2 = 1.0df;
31 if (!__builtin_constant_p (d32_1 + 0.2df))
32 link_error ();
34 if (!__builtin_constant_p (1.0df / 3.0df))
35 link_error ();
37 if (!__builtin_constant_p (d32_2 / d32_1))
38 link_error ();
40 d32_2 = 2.0df;
41 if (!__builtin_constant_p (d32_2 / d32_1))
42 link_error ();
44 return 0;