summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/dfp/inf-1.c
blob: c4f8cd796101bd97ec0e0f2c983ca536a5bdc24a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* N1150 4: Characteristics of decimal floating types (not explicit)
   C99 5.2.4.2.2: Characteristics of floating types.
   A few simple checks on arithmetic operations. */

#include "dfp-dbg.h"

int main()
{
  /* Assumes rounding mode. */
  if (9999999.E90DF + 1.E90df != __builtin_infd32 ())
    FAILURE

  if (!__builtin_isinfd32 (9999999.E90DF + 1.E90df))
    FAILURE

  if (9.999999999999999E384dd + .000000000000001e384dd 
      != __builtin_infd32 ())
    FAILURE

  if (-9999999.E90DF - 1.E90df != -__builtin_infd32 ())
    FAILURE

  if (!__builtin_isinfd32 (9.999999999999999E384dd + .000000000000001e384dd))
    FAILURE

  if (7.999999999999999999999999999999999E6144dl + 3.0E6144dl
      != __builtin_infd32 ())
    FAILURE

  if (__builtin_infd32 () * __builtin_infd32 () != __builtin_infd32 ())
    FAILURE

  if (__builtin_infd32 () * 2 != __builtin_infd32 ())
    FAILURE

  if (__builtin_infd64 () * -5 != -__builtin_infd32 ())
    FAILURE

  if (!__builtin_isinfd128 (__builtin_infd32 () / 4))
    FAILURE

  if (__builtin_infd64 () != __builtin_infd128 ())
    FAILURE

  if (!__builtin_isinfd64 (__builtin_infd128 ()))
    FAILURE

  if (__builtin_finited64 (__builtin_infd32 () * 4))
    FAILURE

  if (!__builtin_finited128 (9.999999E90DL - 1.E90dd))
    FAILURE

  if (__builtin_finited128 (__builtin_infd32 () *__builtin_infd128 ()))
    FAILURE

  if (__builtin_finited32 (__builtin_nand32 ("")))
    FAILURE

  FINISH
}