Daily bump.
[gcc.git] / libstdc++-v3 / testsuite / 28_regex / match_results / 102667.cc
blob1614f3f9eb84d85c50fa58df756589b9126b7f00
1 // { dg-do run { target c++11 } }
2 // { dg-timeout-factor 2 }
4 #include <regex>
5 #include <testsuite_hooks.h>
7 void
8 test01()
10 std::cmatch sm;
11 VERIFY( sm.empty() );
12 VERIFY( sm.size() == 0 );
13 VERIFY( sm.begin() == sm.end() ); // PR libstdc++/83600
15 bool matched = std::regex_match("a", sm, std::regex("b"));
16 VERIFY( ! matched );
17 VERIFY( sm.ready() );
18 VERIFY( sm.empty() );
19 VERIFY( sm.size() == 0 );
20 VERIFY( sm.begin() == sm.end() ); // PR libstdc++/102667
22 matched = std::regex_match("a", sm, std::regex("a"));
23 VERIFY( matched );
24 VERIFY( sm.ready() );
25 VERIFY( ! sm.empty() );
26 VERIFY( sm.size() == 1 );
27 VERIFY( (sm.end() - sm.begin()) == 1 );
29 matched = std::regex_search("abcd", sm, std::regex("(b)(c)"));
30 VERIFY( matched );
31 VERIFY( sm.ready() );
32 VERIFY( ! sm.empty() );
33 VERIFY( sm.size() == 3 );
34 VERIFY( (sm.end() - sm.begin()) == 3 );
37 int main()
39 test01();