[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / strings / string.view / string.view.comparison / opge.string_view.string.pass.cpp
blobdd81e8092f4738379e4cf99e4aa57208ce1eb8be
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 // <string>
11 // template<class charT, class traits, class Allocator>
12 // bool operator>=(const basic_string<charT,traits,Allocator>& lhs,
13 // basic_string_view<charT,traits> rhs);
14 // bool operator>=(basic_string_view<charT,traits> lhs,
15 // const basic_string<charT,traits,Allocator>& rhs);
17 #include <string_view>
18 #include <cassert>
20 #include "test_macros.h"
22 template <class S>
23 void
24 test(const S& lhs, const typename S::value_type* rhs, bool x, bool y)
26 assert((lhs >= rhs) == x);
27 assert((rhs >= lhs) == y);
30 int main(int, char**)
33 typedef std::string_view S;
34 test(S(""), "", true, true);
35 test(S(""), "abcde", false, true);
36 test(S(""), "abcdefghij", false, true);
37 test(S(""), "abcdefghijklmnopqrst", false, true);
38 test(S("abcde"), "", true, false);
39 test(S("abcde"), "abcde", true, true);
40 test(S("abcde"), "abcdefghij", false, true);
41 test(S("abcde"), "abcdefghijklmnopqrst", false, true);
42 test(S("abcdefghij"), "", true, false);
43 test(S("abcdefghij"), "abcde", true, false);
44 test(S("abcdefghij"), "abcdefghij", true, true);
45 test(S("abcdefghij"), "abcdefghijklmnopqrst", false, true);
46 test(S("abcdefghijklmnopqrst"), "", true, false);
47 test(S("abcdefghijklmnopqrst"), "abcde", true, false);
48 test(S("abcdefghijklmnopqrst"), "abcdefghij", true, false);
49 test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true, true);
52 return 0;