[RISCV] Add ESWIN EIC770X (SiFive P550) to getHostCPUNameForRISCV. (#125277)
[llvm-project.git] / libcxx / test / std / re / re.regex / re.regex.construct / ptr_size.pass.cpp
blob1d99069f1b0def90d7f0304fd4ffc0206e355dd8
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 // <regex>
11 // template <class charT, class traits = regex_traits<charT>> class basic_regex;
13 // basic_regex(const charT* p, size_t len);
15 #include <regex>
16 #include <cassert>
18 #include "test_macros.h"
20 template <class CharT>
21 void
22 test(const CharT* p, std::size_t len, unsigned mc)
24 std::basic_regex<CharT> r(p, len);
25 assert(r.flags() == std::regex_constants::ECMAScript);
26 assert(r.mark_count() == mc);
29 int main(int, char**)
31 test("\\(a\\)", 5, 0);
32 test("\\(a[bc]\\)", 9, 0);
33 test("\\(a\\([bc]\\)\\)", 13, 0);
34 test("(a([bc]))", 9, 2);
36 test("(\0)(b)(c)(d)", 12, 4);
37 test("(\0)(b)(c)(d)", 9, 3);
38 test("(\0)(b)(c)(d)", 3, 1);
39 test("(\0)(b)(c)(d)", 0, 0);
41 return 0;