[RISCV][NFC] Remove Redundant Inline Asm Logic (#124202)
[llvm-project.git] / libcxx / test / std / utilities / variant / variant.monostate.relops / relops.pass.cpp
blobfab67be3e4b58b60ac839e7b17366cbefe000364
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14
11 // <variant>
13 // constexpr bool operator<(monostate, monostate) noexcept { return false; }
14 // constexpr bool operator>(monostate, monostate) noexcept { return false; }
15 // constexpr bool operator<=(monostate, monostate) noexcept { return true; }
16 // constexpr bool operator>=(monostate, monostate) noexcept { return true; }
17 // constexpr bool operator==(monostate, monostate) noexcept { return true; }
18 // constexpr bool operator!=(monostate, monostate) noexcept { return false; }
19 // constexpr strong_ordering operator<=>(monostate, monostate) noexcept { return strong_ordering::equal; } // since C++20
21 #include <cassert>
22 #include <variant>
24 #include "test_comparisons.h"
25 #include "test_macros.h"
27 constexpr bool test() {
28 using M = std::monostate;
29 constexpr M m1{};
30 constexpr M m2{};
31 assert(testComparisons(m1, m2, /*isEqual*/ true, /*isLess*/ false));
32 AssertComparisonsAreNoexcept<M>();
34 #if TEST_STD_VER > 17
35 assert(testOrder(m1, m2, std::strong_ordering::equal));
36 AssertOrderAreNoexcept<M>();
37 #endif // TEST_STD_VER > 17
39 return true;
42 int main(int, char**) {
43 test();
44 static_assert(test());
46 return 0;