| 1 |
// PR middle-end/116896 |
| 2 |
// { dg-do run { target c++20 } } |
| 3 |
// { dg-options "-O2" } |
| 4 |
|
| 5 |
#include "pr116896-1.C" |
| 6 |
|
| 7 |
[[gnu::noipa]] auto |
| 8 |
corge (int x) |
| 9 |
{ |
| 10 |
return x <=> 0; |
| 11 |
} |
| 12 |
|
| 13 |
[[gnu::noipa]] auto |
| 14 |
garply (unsigned x) |
| 15 |
{ |
| 16 |
return x <=> 0; |
| 17 |
} |
| 18 |
|
| 19 |
int |
| 20 |
main () |
| 21 |
{ |
| 22 |
if (foo (-1.0f, 1.0f) != std::partial_ordering::less |
| 23 |
|| foo (1.0f, -1.0f) != std::partial_ordering::greater |
| 24 |
|| foo (1.0f, 1.0f) != std::partial_ordering::equivalent |
| 25 |
|| foo (__builtin_nanf (""), 1.0f) != std::partial_ordering::unordered |
| 26 |
|| bar (-2.0f, 2.0f) != std::partial_ordering::less |
| 27 |
|| bar (2.0f, -2.0f) != std::partial_ordering::greater |
| 28 |
|| bar (-5.0f, -5.0f) != std::partial_ordering::equivalent |
| 29 |
|| baz (-42, 42) != std::strong_ordering::less |
| 30 |
|| baz (42, -42) != std::strong_ordering::greater |
| 31 |
|| baz (42, 42) != std::strong_ordering::equal |
| 32 |
|| qux (40, 42) != std::strong_ordering::less |
| 33 |
|| qux (42, 40) != std::strong_ordering::greater |
| 34 |
|| qux (40, 40) != std::strong_ordering::equal |
| 35 |
|| corge (-15) != std::strong_ordering::less |
| 36 |
|| corge (15) != std::strong_ordering::greater |
| 37 |
|| corge (0) != std::strong_ordering::equal |
| 38 |
|| garply (15) != std::strong_ordering::greater |
| 39 |
|| garply (0) != std::strong_ordering::equal) |
| 40 |
__builtin_abort (); |
| 41 |
} |