RISC-V: Add testcases for form 1 of vector signed SAT_SUB
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / ieee / compare-fp-3.c
blob03e6ff2c50667e5718087acb8838bc02ef916be1
1 /* Copyright (C) 2004 Free Software Foundation.
3 Test for composite comparison always true/false optimization.
5 Written by Paolo Bonzini, 26th May 2004. */
7 extern void link_error0 ();
8 extern void link_error1 ();
10 void
11 test1 (float x, float y)
13 if ((x==y) && (x!=y))
14 link_error0();
17 void
18 test2 (float x, float y)
20 if ((x<y) && (x>y))
21 link_error0();
24 void
25 test3 (float x, float y)
27 if ((x<y) && (y<x))
28 link_error0();
31 void
32 test4 (float x, float y)
34 if ((x==y) || (x!=y))
37 else
38 link_error1 ();
41 void
42 test5 (float x, float y)
44 if (__builtin_isunordered (x, y) || (x>=y) || (x<y))
47 else
48 link_error1 ();
51 void
52 test6 (float x, float y)
54 if (__builtin_isunordered (y, x) || (x<=y) || (y<x))
57 else
58 link_error1 ();
61 void
62 test7 (float x, float y)
64 if (__builtin_isunordered (x, y) || !__builtin_isunordered (x, y))
67 else
68 link_error1 ();
71 void
72 all_tests (float x, float y)
74 test1 (x, y);
75 test2 (x, y);
76 test3 (x, y);
77 test4 (x, y);
78 test5 (x, y);
79 test6 (x, y);
80 test7 (x, y);
83 int
84 main ()
86 all_tests (0, 0);
87 all_tests (1, 2);
88 all_tests (4, 3);
90 return 0;
93 #ifndef __OPTIMIZE__
94 void link_error0() {}
95 void link_error1() {}
96 #endif /* ! __OPTIMIZE__ */