Debian Codegraph @

gcc/testsuite/g++.target/i386/excess-precision-12.C

raw
1 // Excess precision tests. Test implicit conversions in 3-way comparisons:
2 // excess precision in C++.
3 // { dg-do run { target c++20 } }
4 // { dg-options "-mfpmath=387 -fexcess-precision=standard" }
5
6 #include <compare>
7 #include <cstdlib>
8
9 int
10 main (void)
11 {
12 float f = 0x1p63f;
13 unsigned long long int u = (1ULL << 63) + 1;
14
15 if ((f <=> u) >= 0)
16 std::abort ();
17
18 if ((u <=> f) <= 0)
19 std::abort ();
20 }