match: Rename to...
authorBenjamin Kosnik <bkoz@redhat.com>
Fri, 5 Oct 2012 21:18:54 +0000 (21:18 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Fri, 5 Oct 2012 21:18:54 +0000 (21:18 +0000)
2012-10-05  Benjamin Kosnik  <bkoz@redhat.com>

* testsuite/28_regex/algorithms/match: Rename to...
* testsuite/28_regex/algorithms/regex_match: ...this.
* testsuite/28_regex/basic_regex/regex.cc: Rename to...
* testsuite/28_regex/basic_regex/ctors/basic/default.cc: ...this.
* testsuite/util/testsuite_regex.h: New.
* testsuite/28_regex/basic_regex/ctors/basic/raw_string.cc: New.

From-SVN: r192146

25 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/28_regex/algorithms/match/basic/string_01.cc [deleted file]
libstdc++-v3/testsuite/28_regex/algorithms/match/basic/string_range_00_03.cc [deleted file]
libstdc++-v3/testsuite/28_regex/algorithms/match/basic/string_range_01_03.cc [deleted file]
libstdc++-v3/testsuite/28_regex/algorithms/match/basic/string_range_02_03.cc [deleted file]
libstdc++-v3/testsuite/28_regex/algorithms/match/extended/cstring_plus.cc [deleted file]
libstdc++-v3/testsuite/28_regex/algorithms/match/extended/cstring_questionmark.cc [deleted file]
libstdc++-v3/testsuite/28_regex/algorithms/match/extended/string_any.cc [deleted file]
libstdc++-v3/testsuite/28_regex/algorithms/match/extended/string_range_00_03.cc [deleted file]
libstdc++-v3/testsuite/28_regex/algorithms/match/extended/string_range_01_03.cc [deleted file]
libstdc++-v3/testsuite/28_regex/algorithms/match/extended/string_range_02_03.cc [deleted file]
libstdc++-v3/testsuite/28_regex/algorithms/regex_match/basic/string_01.cc [new file with mode: 0644]
libstdc++-v3/testsuite/28_regex/algorithms/regex_match/basic/string_range_00_03.cc [new file with mode: 0644]
libstdc++-v3/testsuite/28_regex/algorithms/regex_match/basic/string_range_01_03.cc [new file with mode: 0644]
libstdc++-v3/testsuite/28_regex/algorithms/regex_match/basic/string_range_02_03.cc [new file with mode: 0644]
libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/cstring_plus.cc [new file with mode: 0644]
libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/cstring_questionmark.cc [new file with mode: 0644]
libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/string_any.cc [new file with mode: 0644]
libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/string_range_00_03.cc [new file with mode: 0644]
libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/string_range_01_03.cc [new file with mode: 0644]
libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/string_range_02_03.cc [new file with mode: 0644]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/default.cc [new file with mode: 0644]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/raw_string.cc [new file with mode: 0644]
libstdc++-v3/testsuite/28_regex/basic_regex/regex.cc [deleted file]
libstdc++-v3/testsuite/util/testsuite_regex.h [new file with mode: 0644]

index ed0b7077f267e77b647a73e216da9e61da76d368..c651247fb353a754feeda3575c63322a8e715fe1 100644 (file)
@@ -1,3 +1,12 @@
+2012-10-05  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * testsuite/28_regex/algorithms/match: Rename to...
+       * testsuite/28_regex/algorithms/regex_match: ...this.
+       * testsuite/28_regex/basic_regex/regex.cc: Rename to...
+       * testsuite/28_regex/basic_regex/ctors/basic/default.cc: ...this.
+       * testsuite/util/testsuite_regex.h: New.
+       * testsuite/28_regex/basic_regex/ctors/basic/raw_string.cc: New.
+
 2012-10-05  Jakub Jelinek  <jakub@redhat.com>
 
        * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/match/basic/string_01.cc b/libstdc++-v3/testsuite/28_regex/algorithms/match/basic/string_01.cc
deleted file mode 100644 (file)
index 4a7161a..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-// { dg-options "-std=c++0x" }
-
-//
-// 2010-06-11  Stephen M. Webb <stephen.webb@bregmasoft.ca>
-//
-// Copyright (C) 2010 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3.  If not see
-// <http://www.gnu.org/licenses/>.
-
-// 28.11.2 regex_match
-// Tests BRE against a std::string target.
-
-#include <regex>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-       std::regex  re("\\(a\\).*", std::regex::basic);
-       std::string target("aaba");
-       std::smatch m;
-
-       VERIFY( std::regex_match(target, m, re) );
-
-       VERIFY( m.size()  == re.mark_count()+1 );
-       VERIFY( m.empty() == false );
-       VERIFY( m.prefix().first == target.begin() );
-       VERIFY( m.prefix().second == target.begin() );
-       VERIFY( m.prefix().matched == false );
-       VERIFY( m.suffix().first == target.end() );
-       VERIFY( m.suffix().second == target.end() );
-       VERIFY( m.suffix().matched == false );
-       VERIFY( m[0].first == target.begin() );
-       VERIFY( m[0].second == target.end() );
-       VERIFY( m[0].matched == true );
-       VERIFY( m[1].first == target.begin() );
-       VERIFY( m[1].second == target.begin()+1 );
-       VERIFY( m[1].matched == true );
-}
-
-
-int
-main()
-{ 
-  test01();
-  return 0;
-}
-
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/match/basic/string_range_00_03.cc b/libstdc++-v3/testsuite/28_regex/algorithms/match/basic/string_range_00_03.cc
deleted file mode 100644 (file)
index 6c0fdd7..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// { dg-options "-std=c++0x" }
-
-//
-// 2010-06-16  Stephen M. Webb <stephen.webb@bregmasoft.ca>
-//
-// Copyright (C) 2010 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3.  If not see
-// <http://www.gnu.org/licenses/>.
-
-// 28.11.2 regex_match
-// Tests BRE against a std::string target, exercising range {0,3}
-
-#include <regex>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-       std::regex  re("a\\{0,3\\}", std::regex::basic);
-       std::string target("aa");
-       std::smatch m;
-
-       VERIFY( std::regex_match(target, m, re) );
-
-       VERIFY( m.size()  == re.mark_count()+1 );
-       VERIFY( m.empty() == false );
-       VERIFY( m.prefix().first == target.begin() );
-       VERIFY( m.prefix().second == target.begin() );
-       VERIFY( m.prefix().matched == false );
-       VERIFY( m.suffix().first == target.end() );
-       VERIFY( m.suffix().second == target.end() );
-       VERIFY( m.suffix().matched == false );
-       VERIFY( m[0].first == target.begin() );
-       VERIFY( m[0].second == target.end() );
-       VERIFY( m[0].matched == true );
-}
-
-
-int
-main()
-{ 
-  test01();
-  return 0;
-}
-
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/match/basic/string_range_01_03.cc b/libstdc++-v3/testsuite/28_regex/algorithms/match/basic/string_range_01_03.cc
deleted file mode 100644 (file)
index 3439b54..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// { dg-options "-std=c++0x" }
-
-//
-// 2010-06-16  Stephen M. Webb <stephen.webb@bregmasoft.ca>
-//
-// Copyright (C) 2010 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3.  If not see
-// <http://www.gnu.org/licenses/>.
-
-// 28.11.2 regex_match
-// Tests BRE against a std::string target, exercising range {1,3}
-
-#include <regex>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-       std::regex  re("a\\{1,3\\}", std::regex::basic);
-       std::string target("aa");
-       std::smatch m;
-
-       VERIFY( std::regex_match(target, m, re) );
-
-       VERIFY( m.size()  == re.mark_count()+1 );
-       VERIFY( m.empty() == false );
-       VERIFY( m.prefix().first == target.begin() );
-       VERIFY( m.prefix().second == target.begin() );
-       VERIFY( m.prefix().matched == false );
-       VERIFY( m.suffix().first == target.end() );
-       VERIFY( m.suffix().second == target.end() );
-       VERIFY( m.suffix().matched == false );
-       VERIFY( m[0].first == target.begin() );
-       VERIFY( m[0].second == target.end() );
-       VERIFY( m[0].matched == true );
-}
-
-
-int
-main()
-{ 
-  test01();
-  return 0;
-}
-
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/match/basic/string_range_02_03.cc b/libstdc++-v3/testsuite/28_regex/algorithms/match/basic/string_range_02_03.cc
deleted file mode 100644 (file)
index dfd00a0..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-// { dg-options "-std=c++0x" }
-// { dg-do run { xfail *-*-* } }
-
-//
-// 2010-06-16  Stephen M. Webb <stephen.webb@bregmasoft.ca>
-//
-// Copyright (C) 2010 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3.  If not see
-// <http://www.gnu.org/licenses/>.
-
-// 28.11.2 regex_match
-// Tests BRE against a std::string target, exercising range {2,3}
-
-#include <regex>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-       std::regex  re("a\\{2,3\\}", std::regex::basic);
-       std::string target("aa");
-       std::smatch m;
-
-       VERIFY( std::regex_match(target, m, re) );
-
-       VERIFY( m.size()  == re.mark_count()+1 );
-       VERIFY( m.empty() == false );
-       VERIFY( m.prefix().first == target.begin() );
-       VERIFY( m.prefix().second == target.begin() );
-       VERIFY( m.prefix().matched == false );
-       VERIFY( m.suffix().first == target.end() );
-       VERIFY( m.suffix().second == target.end() );
-       VERIFY( m.suffix().matched == false );
-       VERIFY( m[0].first == target.begin() );
-       VERIFY( m[0].second == target.end() );
-       VERIFY( m[0].matched == true );
-}
-
-
-int
-main()
-{ 
-  test01();
-  return 0;
-}
-
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/match/extended/cstring_plus.cc b/libstdc++-v3/testsuite/28_regex/algorithms/match/extended/cstring_plus.cc
deleted file mode 100644 (file)
index ad0f57e..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-// { dg-options "-std=c++0x" }
-// { dg-do run { xfail *-*-* } }
-
-//
-// 2010-06-21  Stephen M. Webb <stephen.webb@bregmasoft.ca>
-//
-// Copyright (C) 2010 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3.  If not see
-// <http://www.gnu.org/licenses/>.
-
-// 28.11.2 regex_match
-// Tests ERE against a C-string target, plus-sign match.
-
-#include <regex>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-       std::regex  re("(a+)", std::regex::extended);
-       const char target[] = "aa";
-       std::cmatch m;
-
-       VERIFY( std::regex_match(target, m, re) );
-
-       VERIFY( re.mark_count() == 1 );
-       VERIFY( m.size()  == re.mark_count()+1 );
-       VERIFY( m.empty() == false );
-       VERIFY( m.prefix().first == target );
-       VERIFY( m.prefix().second == target );
-       VERIFY( m.prefix().matched == false );
-       VERIFY( m.suffix().first == target+sizeof(target) );
-       VERIFY( m.suffix().second == target+sizeof(target) );
-       VERIFY( m.suffix().matched == false );
-       VERIFY( m[0].first == target );
-       VERIFY( m[0].second == target+sizeof(target) );
-       VERIFY( m[0].matched == true );
-       VERIFY( m[1].first == target );
-       VERIFY( m[1].second == target+sizeof(target) );
-       VERIFY( m[1].matched == true );
-}
-
-
-int
-main()
-{ 
-  test01();
-  return 0;
-}
-
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/match/extended/cstring_questionmark.cc b/libstdc++-v3/testsuite/28_regex/algorithms/match/extended/cstring_questionmark.cc
deleted file mode 100644 (file)
index 21abea4..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-// { dg-options "-std=c++0x" }
-// { dg-do run { xfail *-*-* } }
-
-//
-// 2010-06-21  Stephen M. Webb <stephen.webb@bregmasoft.ca>
-//
-// Copyright (C) 2010 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3.  If not see
-// <http://www.gnu.org/licenses/>.
-
-// 28.11.2 regex_match
-// Tests ERE against a C-string target, question-mark match.
-
-#include <regex>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-       std::regex  re("(aa?)", std::regex::extended);
-       char target[] = "a";
-       std::cmatch m;
-
-       VERIFY( std::regex_match(target, m, re) );
-
-       VERIFY( re.mark_count() == 1 );
-       VERIFY( m.size()  == re.mark_count()+1 );
-       VERIFY( m.empty() == false );
-       VERIFY( m.prefix().first == target );
-       VERIFY( m.prefix().second == target );
-       VERIFY( m.prefix().matched == false );
-       VERIFY( m.suffix().first == target+sizeof(target) );
-       VERIFY( m.suffix().second == target+sizeof(target) );
-       VERIFY( m.suffix().matched == false );
-       VERIFY( m[0].first == target );
-       VERIFY( m[0].second == target+sizeof(target) );
-       VERIFY( m[0].matched == true );
-       VERIFY( m[1].first == target );
-       VERIFY( m[1].second == target+sizeof(target) );
-       VERIFY( m[1].matched == true );
-}
-
-
-int
-main()
-{ 
-  test01();
-  return 0;
-}
-
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/match/extended/string_any.cc b/libstdc++-v3/testsuite/28_regex/algorithms/match/extended/string_any.cc
deleted file mode 100644 (file)
index 8d3716b..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// { dg-options "-std=c++0x" }
-
-//
-// 2010-06-11  Stephen M. Webb <stephen.webb@bregmasoft.ca>
-//
-// Copyright (C) 2010 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3.  If not see
-// <http://www.gnu.org/licenses/>.
-
-// 28.11.2 regex_match
-// Tests ERE against a std::string target.
-
-#include <regex>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-       std::regex  re(".*", std::regex::extended);
-       std::string target("aaba");
-       std::smatch m;
-
-       VERIFY( std::regex_match(target, m, re) );
-
-       VERIFY( m.size()  == re.mark_count()+1 );
-       VERIFY( m.empty() == false );
-       VERIFY( m.prefix().first == target.begin() );
-       VERIFY( m.prefix().second == target.begin() );
-       VERIFY( m.prefix().matched == false );
-       VERIFY( m.suffix().first == target.end() );
-       VERIFY( m.suffix().second == target.end() );
-       VERIFY( m.suffix().matched == false );
-       VERIFY( m[0].first == target.begin() );
-       VERIFY( m[0].second == target.end() );
-       VERIFY( m[0].matched == true );
-}
-
-
-int
-main()
-{ 
-  test01();
-  return 0;
-}
-
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/match/extended/string_range_00_03.cc b/libstdc++-v3/testsuite/28_regex/algorithms/match/extended/string_range_00_03.cc
deleted file mode 100644 (file)
index a0a2e1f..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// { dg-options "-std=c++0x" }
-
-//
-// 2010-06-16  Stephen M. Webb <stephen.webb@bregmasoft.ca>
-//
-// Copyright (C) 2010 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3.  If not see
-// <http://www.gnu.org/licenses/>.
-
-// 28.11.2 regex_match
-// Tests ERE against a std::string target, exercising range {0,3}
-
-#include <regex>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-       std::regex  re("a{0,3}", std::regex::extended);
-       std::string target("aa");
-       std::smatch m;
-
-       VERIFY( std::regex_match(target, m, re) );
-
-       VERIFY( m.size()  == re.mark_count()+1 );
-       VERIFY( m.empty() == false );
-       VERIFY( m.prefix().first == target.begin() );
-       VERIFY( m.prefix().second == target.begin() );
-       VERIFY( m.prefix().matched == false );
-       VERIFY( m.suffix().first == target.end() );
-       VERIFY( m.suffix().second == target.end() );
-       VERIFY( m.suffix().matched == false );
-       VERIFY( m[0].first == target.begin() );
-       VERIFY( m[0].second == target.end() );
-       VERIFY( m[0].matched == true );
-}
-
-
-int
-main()
-{ 
-  test01();
-  return 0;
-}
-
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/match/extended/string_range_01_03.cc b/libstdc++-v3/testsuite/28_regex/algorithms/match/extended/string_range_01_03.cc
deleted file mode 100644 (file)
index b50e076..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// { dg-options "-std=c++0x" }
-
-//
-// 2010-06-16  Stephen M. Webb <stephen.webb@bregmasoft.ca>
-//
-// Copyright (C) 2010 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3.  If not see
-// <http://www.gnu.org/licenses/>.
-
-// 28.11.2 regex_match
-// Tests ERE against a std::string target, exercising range {1,3}
-
-#include <regex>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-       std::regex  re("a{1,3}", std::regex::extended);
-       std::string target("aa");
-       std::smatch m;
-
-       VERIFY( std::regex_match(target, m, re) );
-
-       VERIFY( m.size()  == re.mark_count()+1 );
-       VERIFY( m.empty() == false );
-       VERIFY( m.prefix().first == target.begin() );
-       VERIFY( m.prefix().second == target.begin() );
-       VERIFY( m.prefix().matched == false );
-       VERIFY( m.suffix().first == target.end() );
-       VERIFY( m.suffix().second == target.end() );
-       VERIFY( m.suffix().matched == false );
-       VERIFY( m[0].first == target.begin() );
-       VERIFY( m[0].second == target.end() );
-       VERIFY( m[0].matched == true );
-}
-
-
-int
-main()
-{ 
-  test01();
-  return 0;
-}
-
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/match/extended/string_range_02_03.cc b/libstdc++-v3/testsuite/28_regex/algorithms/match/extended/string_range_02_03.cc
deleted file mode 100644 (file)
index ca322a8..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-// { dg-options "-std=c++0x" }
-// { dg-do run { xfail *-*-* } }
-
-//
-// 2010-06-16  Stephen M. Webb <stephen.webb@bregmasoft.ca>
-//
-// Copyright (C) 2010 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3.  If not see
-// <http://www.gnu.org/licenses/>.
-
-// 28.11.2 regex_match
-// Tests ERE against a std::string target, exercising range {2,3}
-
-#include <regex>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
-  bool test __attribute__((unused)) = true;
-
-       std::regex  re("a{2,3}", std::regex::extended);
-       std::string target("aa");
-       std::smatch m;
-
-       VERIFY( std::regex_match(target, m, re) );
-
-       VERIFY( m.size()  == re.mark_count()+1 );
-       VERIFY( m.empty() == false );
-       VERIFY( m.prefix().first == target.begin() );
-       VERIFY( m.prefix().second == target.begin() );
-       VERIFY( m.prefix().matched == false );
-       VERIFY( m.suffix().first == target.end() );
-       VERIFY( m.suffix().second == target.end() );
-       VERIFY( m.suffix().matched == false );
-       VERIFY( m[0].first == target.begin() );
-       VERIFY( m[0].second == target.end() );
-       VERIFY( m[0].matched == true );
-}
-
-
-int
-main()
-{ 
-  test01();
-  return 0;
-}
-
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/basic/string_01.cc b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/basic/string_01.cc
new file mode 100644 (file)
index 0000000..4a7161a
--- /dev/null
@@ -0,0 +1,63 @@
+// { dg-options "-std=c++0x" }
+
+//
+// 2010-06-11  Stephen M. Webb <stephen.webb@bregmasoft.ca>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// 28.11.2 regex_match
+// Tests BRE against a std::string target.
+
+#include <regex>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+       std::regex  re("\\(a\\).*", std::regex::basic);
+       std::string target("aaba");
+       std::smatch m;
+
+       VERIFY( std::regex_match(target, m, re) );
+
+       VERIFY( m.size()  == re.mark_count()+1 );
+       VERIFY( m.empty() == false );
+       VERIFY( m.prefix().first == target.begin() );
+       VERIFY( m.prefix().second == target.begin() );
+       VERIFY( m.prefix().matched == false );
+       VERIFY( m.suffix().first == target.end() );
+       VERIFY( m.suffix().second == target.end() );
+       VERIFY( m.suffix().matched == false );
+       VERIFY( m[0].first == target.begin() );
+       VERIFY( m[0].second == target.end() );
+       VERIFY( m[0].matched == true );
+       VERIFY( m[1].first == target.begin() );
+       VERIFY( m[1].second == target.begin()+1 );
+       VERIFY( m[1].matched == true );
+}
+
+
+int
+main()
+{ 
+  test01();
+  return 0;
+}
+
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/basic/string_range_00_03.cc b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/basic/string_range_00_03.cc
new file mode 100644 (file)
index 0000000..6c0fdd7
--- /dev/null
@@ -0,0 +1,60 @@
+// { dg-options "-std=c++0x" }
+
+//
+// 2010-06-16  Stephen M. Webb <stephen.webb@bregmasoft.ca>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// 28.11.2 regex_match
+// Tests BRE against a std::string target, exercising range {0,3}
+
+#include <regex>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+       std::regex  re("a\\{0,3\\}", std::regex::basic);
+       std::string target("aa");
+       std::smatch m;
+
+       VERIFY( std::regex_match(target, m, re) );
+
+       VERIFY( m.size()  == re.mark_count()+1 );
+       VERIFY( m.empty() == false );
+       VERIFY( m.prefix().first == target.begin() );
+       VERIFY( m.prefix().second == target.begin() );
+       VERIFY( m.prefix().matched == false );
+       VERIFY( m.suffix().first == target.end() );
+       VERIFY( m.suffix().second == target.end() );
+       VERIFY( m.suffix().matched == false );
+       VERIFY( m[0].first == target.begin() );
+       VERIFY( m[0].second == target.end() );
+       VERIFY( m[0].matched == true );
+}
+
+
+int
+main()
+{ 
+  test01();
+  return 0;
+}
+
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/basic/string_range_01_03.cc b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/basic/string_range_01_03.cc
new file mode 100644 (file)
index 0000000..3439b54
--- /dev/null
@@ -0,0 +1,60 @@
+// { dg-options "-std=c++0x" }
+
+//
+// 2010-06-16  Stephen M. Webb <stephen.webb@bregmasoft.ca>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// 28.11.2 regex_match
+// Tests BRE against a std::string target, exercising range {1,3}
+
+#include <regex>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+       std::regex  re("a\\{1,3\\}", std::regex::basic);
+       std::string target("aa");
+       std::smatch m;
+
+       VERIFY( std::regex_match(target, m, re) );
+
+       VERIFY( m.size()  == re.mark_count()+1 );
+       VERIFY( m.empty() == false );
+       VERIFY( m.prefix().first == target.begin() );
+       VERIFY( m.prefix().second == target.begin() );
+       VERIFY( m.prefix().matched == false );
+       VERIFY( m.suffix().first == target.end() );
+       VERIFY( m.suffix().second == target.end() );
+       VERIFY( m.suffix().matched == false );
+       VERIFY( m[0].first == target.begin() );
+       VERIFY( m[0].second == target.end() );
+       VERIFY( m[0].matched == true );
+}
+
+
+int
+main()
+{ 
+  test01();
+  return 0;
+}
+
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/basic/string_range_02_03.cc b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/basic/string_range_02_03.cc
new file mode 100644 (file)
index 0000000..dfd00a0
--- /dev/null
@@ -0,0 +1,61 @@
+// { dg-options "-std=c++0x" }
+// { dg-do run { xfail *-*-* } }
+
+//
+// 2010-06-16  Stephen M. Webb <stephen.webb@bregmasoft.ca>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// 28.11.2 regex_match
+// Tests BRE against a std::string target, exercising range {2,3}
+
+#include <regex>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+       std::regex  re("a\\{2,3\\}", std::regex::basic);
+       std::string target("aa");
+       std::smatch m;
+
+       VERIFY( std::regex_match(target, m, re) );
+
+       VERIFY( m.size()  == re.mark_count()+1 );
+       VERIFY( m.empty() == false );
+       VERIFY( m.prefix().first == target.begin() );
+       VERIFY( m.prefix().second == target.begin() );
+       VERIFY( m.prefix().matched == false );
+       VERIFY( m.suffix().first == target.end() );
+       VERIFY( m.suffix().second == target.end() );
+       VERIFY( m.suffix().matched == false );
+       VERIFY( m[0].first == target.begin() );
+       VERIFY( m[0].second == target.end() );
+       VERIFY( m[0].matched == true );
+}
+
+
+int
+main()
+{ 
+  test01();
+  return 0;
+}
+
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/cstring_plus.cc b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/cstring_plus.cc
new file mode 100644 (file)
index 0000000..ad0f57e
--- /dev/null
@@ -0,0 +1,65 @@
+// { dg-options "-std=c++0x" }
+// { dg-do run { xfail *-*-* } }
+
+//
+// 2010-06-21  Stephen M. Webb <stephen.webb@bregmasoft.ca>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// 28.11.2 regex_match
+// Tests ERE against a C-string target, plus-sign match.
+
+#include <regex>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+       std::regex  re("(a+)", std::regex::extended);
+       const char target[] = "aa";
+       std::cmatch m;
+
+       VERIFY( std::regex_match(target, m, re) );
+
+       VERIFY( re.mark_count() == 1 );
+       VERIFY( m.size()  == re.mark_count()+1 );
+       VERIFY( m.empty() == false );
+       VERIFY( m.prefix().first == target );
+       VERIFY( m.prefix().second == target );
+       VERIFY( m.prefix().matched == false );
+       VERIFY( m.suffix().first == target+sizeof(target) );
+       VERIFY( m.suffix().second == target+sizeof(target) );
+       VERIFY( m.suffix().matched == false );
+       VERIFY( m[0].first == target );
+       VERIFY( m[0].second == target+sizeof(target) );
+       VERIFY( m[0].matched == true );
+       VERIFY( m[1].first == target );
+       VERIFY( m[1].second == target+sizeof(target) );
+       VERIFY( m[1].matched == true );
+}
+
+
+int
+main()
+{ 
+  test01();
+  return 0;
+}
+
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/cstring_questionmark.cc b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/cstring_questionmark.cc
new file mode 100644 (file)
index 0000000..21abea4
--- /dev/null
@@ -0,0 +1,65 @@
+// { dg-options "-std=c++0x" }
+// { dg-do run { xfail *-*-* } }
+
+//
+// 2010-06-21  Stephen M. Webb <stephen.webb@bregmasoft.ca>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// 28.11.2 regex_match
+// Tests ERE against a C-string target, question-mark match.
+
+#include <regex>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+       std::regex  re("(aa?)", std::regex::extended);
+       char target[] = "a";
+       std::cmatch m;
+
+       VERIFY( std::regex_match(target, m, re) );
+
+       VERIFY( re.mark_count() == 1 );
+       VERIFY( m.size()  == re.mark_count()+1 );
+       VERIFY( m.empty() == false );
+       VERIFY( m.prefix().first == target );
+       VERIFY( m.prefix().second == target );
+       VERIFY( m.prefix().matched == false );
+       VERIFY( m.suffix().first == target+sizeof(target) );
+       VERIFY( m.suffix().second == target+sizeof(target) );
+       VERIFY( m.suffix().matched == false );
+       VERIFY( m[0].first == target );
+       VERIFY( m[0].second == target+sizeof(target) );
+       VERIFY( m[0].matched == true );
+       VERIFY( m[1].first == target );
+       VERIFY( m[1].second == target+sizeof(target) );
+       VERIFY( m[1].matched == true );
+}
+
+
+int
+main()
+{ 
+  test01();
+  return 0;
+}
+
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/string_any.cc b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/string_any.cc
new file mode 100644 (file)
index 0000000..8d3716b
--- /dev/null
@@ -0,0 +1,60 @@
+// { dg-options "-std=c++0x" }
+
+//
+// 2010-06-11  Stephen M. Webb <stephen.webb@bregmasoft.ca>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// 28.11.2 regex_match
+// Tests ERE against a std::string target.
+
+#include <regex>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+       std::regex  re(".*", std::regex::extended);
+       std::string target("aaba");
+       std::smatch m;
+
+       VERIFY( std::regex_match(target, m, re) );
+
+       VERIFY( m.size()  == re.mark_count()+1 );
+       VERIFY( m.empty() == false );
+       VERIFY( m.prefix().first == target.begin() );
+       VERIFY( m.prefix().second == target.begin() );
+       VERIFY( m.prefix().matched == false );
+       VERIFY( m.suffix().first == target.end() );
+       VERIFY( m.suffix().second == target.end() );
+       VERIFY( m.suffix().matched == false );
+       VERIFY( m[0].first == target.begin() );
+       VERIFY( m[0].second == target.end() );
+       VERIFY( m[0].matched == true );
+}
+
+
+int
+main()
+{ 
+  test01();
+  return 0;
+}
+
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/string_range_00_03.cc b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/string_range_00_03.cc
new file mode 100644 (file)
index 0000000..a0a2e1f
--- /dev/null
@@ -0,0 +1,60 @@
+// { dg-options "-std=c++0x" }
+
+//
+// 2010-06-16  Stephen M. Webb <stephen.webb@bregmasoft.ca>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// 28.11.2 regex_match
+// Tests ERE against a std::string target, exercising range {0,3}
+
+#include <regex>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+       std::regex  re("a{0,3}", std::regex::extended);
+       std::string target("aa");
+       std::smatch m;
+
+       VERIFY( std::regex_match(target, m, re) );
+
+       VERIFY( m.size()  == re.mark_count()+1 );
+       VERIFY( m.empty() == false );
+       VERIFY( m.prefix().first == target.begin() );
+       VERIFY( m.prefix().second == target.begin() );
+       VERIFY( m.prefix().matched == false );
+       VERIFY( m.suffix().first == target.end() );
+       VERIFY( m.suffix().second == target.end() );
+       VERIFY( m.suffix().matched == false );
+       VERIFY( m[0].first == target.begin() );
+       VERIFY( m[0].second == target.end() );
+       VERIFY( m[0].matched == true );
+}
+
+
+int
+main()
+{ 
+  test01();
+  return 0;
+}
+
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/string_range_01_03.cc b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/string_range_01_03.cc
new file mode 100644 (file)
index 0000000..b50e076
--- /dev/null
@@ -0,0 +1,60 @@
+// { dg-options "-std=c++0x" }
+
+//
+// 2010-06-16  Stephen M. Webb <stephen.webb@bregmasoft.ca>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// 28.11.2 regex_match
+// Tests ERE against a std::string target, exercising range {1,3}
+
+#include <regex>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+       std::regex  re("a{1,3}", std::regex::extended);
+       std::string target("aa");
+       std::smatch m;
+
+       VERIFY( std::regex_match(target, m, re) );
+
+       VERIFY( m.size()  == re.mark_count()+1 );
+       VERIFY( m.empty() == false );
+       VERIFY( m.prefix().first == target.begin() );
+       VERIFY( m.prefix().second == target.begin() );
+       VERIFY( m.prefix().matched == false );
+       VERIFY( m.suffix().first == target.end() );
+       VERIFY( m.suffix().second == target.end() );
+       VERIFY( m.suffix().matched == false );
+       VERIFY( m[0].first == target.begin() );
+       VERIFY( m[0].second == target.end() );
+       VERIFY( m[0].matched == true );
+}
+
+
+int
+main()
+{ 
+  test01();
+  return 0;
+}
+
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/string_range_02_03.cc b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/string_range_02_03.cc
new file mode 100644 (file)
index 0000000..ca322a8
--- /dev/null
@@ -0,0 +1,61 @@
+// { dg-options "-std=c++0x" }
+// { dg-do run { xfail *-*-* } }
+
+//
+// 2010-06-16  Stephen M. Webb <stephen.webb@bregmasoft.ca>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// 28.11.2 regex_match
+// Tests ERE against a std::string target, exercising range {2,3}
+
+#include <regex>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+  bool test __attribute__((unused)) = true;
+
+       std::regex  re("a{2,3}", std::regex::extended);
+       std::string target("aa");
+       std::smatch m;
+
+       VERIFY( std::regex_match(target, m, re) );
+
+       VERIFY( m.size()  == re.mark_count()+1 );
+       VERIFY( m.empty() == false );
+       VERIFY( m.prefix().first == target.begin() );
+       VERIFY( m.prefix().second == target.begin() );
+       VERIFY( m.prefix().matched == false );
+       VERIFY( m.suffix().first == target.end() );
+       VERIFY( m.suffix().second == target.end() );
+       VERIFY( m.suffix().matched == false );
+       VERIFY( m[0].first == target.begin() );
+       VERIFY( m[0].second == target.end() );
+       VERIFY( m[0].matched == true );
+}
+
+
+int
+main()
+{ 
+  test01();
+  return 0;
+}
+
diff --git a/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/default.cc b/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/default.cc
new file mode 100644 (file)
index 0000000..8a803ed
--- /dev/null
@@ -0,0 +1,37 @@
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+// 2007-03-12  Stephen M. Webb  <stephen.webb@bregmasoft.com>
+//
+// Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// 7.4 typedef std::regex
+
+#include <regex>
+
+void
+test01() 
+{ 
+  std::regex re;
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/raw_string.cc b/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/raw_string.cc
new file mode 100644 (file)
index 0000000..0ab42eb
--- /dev/null
@@ -0,0 +1,52 @@
+// { dg-options "-std=c++0x" }
+// { dg-do run { xfail *-*-* } }
+
+// 2012-08-20  Benjamin Kosnik <bkoz@redhat.com>
+//
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// basic_regex constructors + raw string literals
+
+#include <regex>
+#include <testsuite_regex.h>
+
+void
+test01()
+{
+  using namespace __gnu_test;
+
+  // raw string literals
+
+  //string_type sre0(R"(\d{3}-\d{3}-\d{4})"); // expected fail
+
+  string_type sre1(R"( this\n  and new : forms\n  )");
+
+  string_type sre2(R"([:num:]{3}-[:num:]{3}-[:num:]{4})");
+
+  // 1
+  regex_type re(R"( this\n  and new : forms\n  )", std::regex::basic);
+
+  // 2
+  regex_sanity_check(sre1);
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/28_regex/basic_regex/regex.cc b/libstdc++-v3/testsuite/28_regex/basic_regex/regex.cc
deleted file mode 100644 (file)
index 8a803ed..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
-
-// 2007-03-12  Stephen M. Webb  <stephen.webb@bregmasoft.com>
-//
-// Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library.  This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3.  If not see
-// <http://www.gnu.org/licenses/>.
-
-// 7.4 typedef std::regex
-
-#include <regex>
-
-void
-test01() 
-{ 
-  std::regex re;
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/util/testsuite_regex.h b/libstdc++-v3/testsuite/util/testsuite_regex.h
new file mode 100644 (file)
index 0000000..dbf4b34
--- /dev/null
@@ -0,0 +1,130 @@
+// -*- C++ -*-
+// regex utils for the C++ library testsuite.
+//
+// Copyright (C) 2012 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+//
+
+#include <regex>
+#include <stdexcept>
+#include <iostream>
+
+#ifndef _TESTSUITE_REGEX_H
+#define _TESTSUITE_REGEX_H 1
+
+namespace __gnu_test
+{
+  // Test on a compilation of simple expressions, throw regex_error on error.
+  typedef std::regex                           regex_type;
+  typedef regex_type::flag_type                        flag_type;
+  typedef std::regex_constants::error_type     error_type;
+  typedef std::size_t                          size_type;
+  typedef std::string                          string_type;
+
+  // Utilities
+  struct regex_expected_fail { };
+
+  const error_type regex_error_internal(static_cast<error_type>(-1));
+
+  // Stringify error codes for text logging.
+  const char* regex_error_codes[] =
+    {
+    "error_collate",
+    "error_ctype",
+    "error_escape",
+    "error_backref",
+    "error_brack",
+    "error_paren",
+    "error_brace",
+    "error_badbrace",
+    "error_range",
+    "error_space",
+    "error_badrepeat",
+    "error_complexity",
+    "error_stack"
+  };
+
+  void
+  show_regex_error_codes()
+  {
+    using namespace std;
+    using namespace std::regex_constants;
+    const char tab('\t');
+    cout << "error_collate =   " << tab << error_collate << endl;
+    cout << "error_ctype =     " << tab << error_ctype << endl;
+    cout << "error_escape =    " << tab << error_escape << endl;
+    cout << "error_backref =   " << tab << error_backref << endl;
+    cout << "error_brack =     " << tab << error_brack << endl;
+    cout << "error_paren =     " << tab << error_paren << endl;
+    cout << "error_brace =     " << tab << error_brace << endl;
+    cout << "error_badbrace =  " << tab << error_badbrace << endl;
+    cout << "error_range =     " << tab << error_range << endl;
+    cout << "error_space =     " << tab << error_space << endl;
+    cout << "error_badrepeat = " << tab << error_badrepeat << endl;
+    cout << "error_complexity =" << tab << error_complexity << endl;
+    cout << "error_stack =     " << tab << error_stack << endl;
+  }
+
+  // Arguments
+  // string __res: the regular expression string
+  // flag_type __f: flag
+  // __error: expected error, if any
+  void
+  regex_sanity_check(const string_type& __res,
+                    flag_type __f = regex_type::basic,
+                    error_type __error =  regex_error_internal)
+  {
+    using namespace std;
+
+    try
+      {
+       regex_type reo(__res, __f);
+       auto n = reo.mark_count();
+       cout << "regex_type::mark_count " << n << endl;
+      }
+    catch (const regex_error& e)
+      {
+       cout << "regex_sanity_check: "  << __res << endl;
+       cout << "regex_error::what " << e.what() << endl;
+
+       show_regex_error_codes();
+       cout << "regex_error::code " << regex_error_codes[e.code()] << endl;
+       
+       if (__error != regex_error_internal)
+         {
+           // Then expected error_type is __error. Check.
+           if (__error != e.code())
+             {
+               throw regex_expected_fail();
+             }
+         }
+       throw;
+      }
+    catch (const logic_error& e)
+      {
+       cout << "logic_error::what " << e.what() << endl;
+       throw;
+      }
+    catch (const std::exception& e)
+      {
+       cout << "exception: " << endl;
+       throw;
+      }
+  }
+
+} // namespace __gnu_test
+#endif