[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / re / re.const / re.matchflag / match_not_bol.pass.cpp
blob82395e2f2d4d56141e1b0c07e867e3acb65da805
1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
10 // <regex>
12 // match_not_bol:
13 // The first character in the sequence [first,last) shall be treated as
14 // though it is not at the beginning of a line, so the character ^ in the
15 // regular expression shall not match [first,first).
17 #include <regex>
18 #include <cassert>
19 #include "test_macros.h"
21 int main(int, char**)
24 std::string target = "foo";
25 std::regex re("^foo");
26 assert( std::regex_match(target, re));
27 assert(!std::regex_match(target, re, std::regex_constants::match_not_bol));
31 std::string target = "foo";
32 std::regex re("foo");
33 assert( std::regex_match(target, re));
34 assert( std::regex_match(target, re, std::regex_constants::match_not_bol));
38 std::string target = "fooby";
39 std::regex re("^foo");
40 assert( std::regex_search(target, re));
41 assert(!std::regex_search(target, re, std::regex_constants::match_not_bol));
45 std::string target = "fooby";
46 std::regex re("foo");
47 assert( std::regex_search(target, re));
48 assert( std::regex_search(target, re, std::regex_constants::match_not_bol));
51 return 0;