[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / containers / sequences / array / compare.pass.cpp
blobc89216c8bb87e7046b0d11139909eb79b344d2c3
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 // <array>
11 // bool operator==(array<T, N> const&, array<T, N> const&); // constexpr in C++20
12 // bool operator!=(array<T, N> const&, array<T, N> const&); // constexpr in C++20
13 // bool operator<(array<T, N> const&, array<T, N> const&); // constexpr in C++20
14 // bool operator<=(array<T, N> const&, array<T, N> const&); // constexpr in C++20
15 // bool operator>(array<T, N> const&, array<T, N> const&); // constexpr in C++20
16 // bool operator>=(array<T, N> const&, array<T, N> const&); // constexpr in C++20
19 #include <array>
20 #include <cassert>
22 #include "test_macros.h"
23 #include "test_comparisons.h"
25 // std::array is explicitly allowed to be initialized with A a = { init-list };.
26 // Disable the missing braces warning for this reason.
27 #include "disable_missing_braces_warning.h"
29 TEST_CONSTEXPR_CXX20 bool tests()
32 typedef std::array<int, 3> C;
33 C c1 = {1, 2, 3};
34 C c2 = {1, 2, 3};
35 C c3 = {3, 2, 1};
36 C c4 = {1, 2, 1};
37 assert(testComparisons6(c1, c2, true, false));
38 assert(testComparisons6(c1, c3, false, true));
39 assert(testComparisons6(c1, c4, false, false));
42 typedef std::array<int, 0> C;
43 C c1 = {};
44 C c2 = {};
45 assert(testComparisons6(c1, c2, true, false));
48 return true;
51 int main(int, char**)
53 tests();
54 #if TEST_STD_VER >= 20
55 static_assert(tests(), "");
56 #endif
57 return 0;