summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/unordered-3.c
blob: d08abd0ca03f46003d28cde377c9da69615f7219 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* { dg-do link } */
/* { dg-options "-fno-finite-math-only" }  */

void link_error ();

void test1()
{
  if (__builtin_isgreater(1.0,__builtin_nan("")) != 0)
    link_error ();
  if (__builtin_isgreater(__builtin_nan(""),1.0) != 0)
    link_error ();

  if (__builtin_isgreaterequal(1.0,__builtin_nan("")) != 0)
    link_error ();
  if (__builtin_isgreaterequal(__builtin_nan(""),1.0) != 0)
    link_error ();

  if (__builtin_isless(1.0,__builtin_nan("")) != 0)
    link_error ();
  if (__builtin_isless(__builtin_nan(""),1.0) != 0)
    link_error ();

  if (__builtin_islessequal(1.0,__builtin_nan("")) != 0)
    link_error ();
  if (__builtin_islessequal(__builtin_nan(""),1.0) != 0)
    link_error ();

  if (__builtin_islessgreater(1.0,__builtin_nan("")) != 0)
    link_error ();
  if (__builtin_islessgreater(__builtin_nan(""),1.0) != 0)
    link_error ();

  if (__builtin_isunordered(1.0,__builtin_nan("")) == 0)
    link_error ();
  if (__builtin_isunordered(__builtin_nan(""),1.0) == 0)
    link_error ();
}


void test2(double x)
{
  if (__builtin_isgreater(x,__builtin_nan("")) != 0)
    link_error ();
  if (__builtin_isgreater(__builtin_nan(""),x) != 0)
    link_error ();

  if (__builtin_isgreaterequal(x,__builtin_nan("")) != 0)
    link_error ();
  if (__builtin_isgreaterequal(__builtin_nan(""),x) != 0)
    link_error ();

  if (__builtin_isless(x,__builtin_nan("")) != 0)
    link_error ();
  if (__builtin_isless(__builtin_nan(""),x) != 0)
    link_error ();

  if (__builtin_islessequal(x,__builtin_nan("")) != 0)
    link_error ();
  if (__builtin_islessequal(__builtin_nan(""),x) != 0)
    link_error ();

  if (__builtin_islessgreater(x,__builtin_nan("")) != 0)
    link_error ();
  if (__builtin_islessgreater(__builtin_nan(""),x) != 0)
    link_error ();

  if (__builtin_isunordered(x,__builtin_nan("")) == 0)
    link_error ();
  if (__builtin_isunordered(__builtin_nan(""),x) == 0)
    link_error ();
}


int main()
{
  test1 ();
  test2 (1.0);
  return 0;
}