diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /libstdc++-v3/testsuite/tr1/7_regular_expressions | |
download | cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2 cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'libstdc++-v3/testsuite/tr1/7_regular_expressions')
36 files changed, 1543 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/cstring.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/cstring.cc new file mode 100644 index 000000000..4a387dee3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/cstring.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests assign operation from a C-style null-terminated-string. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + const char* cs = "aab"; + test_type re; + re.assign(cs); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/cstring_op.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/cstring_op.cc new file mode 100644 index 000000000..1cbc2f94c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/cstring_op.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests basic_regex assign operator from a C-style null-terminated-string. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + const char* cs = "aab"; + test_type re; + re = cs; +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/pstring.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/pstring.cc new file mode 100644 index 000000000..534fb4b87 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/pstring.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests assign operation from a Pascal-style counted-string. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + const char cs[] = "aab"; + test_type re; + re.assign(cs, sizeof(cs)-1, std::tr1::regex_constants::basic); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/range.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/range.cc new file mode 100644 index 000000000..3f8595de9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/range.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests range assign of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + char s[] = "a+b|c"; + test_type re; + re.assign(s, s + 5); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/string.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/string.cc new file mode 100644 index 000000000..d80c5676b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/string.cc @@ -0,0 +1,43 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <string> +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests C++ string assignment of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + std::string s("a*b"); + test_type re; + re.assign(s); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/string_op.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/string_op.cc new file mode 100644 index 000000000..67b806842 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/char/string_op.cc @@ -0,0 +1,43 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <string> +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests basic_regex assignment operator from a C++ string; +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + std::string s("a*b"); + test_type re; + re = s; +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/cstring.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/cstring.cc new file mode 100644 index 000000000..4de61bda3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/cstring.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests assign operation from a C-style null-terminated-string. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + const wchar_t* cs = L"aab"; + test_type re; + re.assign(cs); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/cstring_op.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/cstring_op.cc new file mode 100644 index 000000000..9e1dfaa0a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/cstring_op.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests basic_regex assign operator from a C-style null-terminated-string. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + const wchar_t* cs = L"aab"; + test_type re; + re = cs; +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/pstring.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/pstring.cc new file mode 100644 index 000000000..91a9e6ea6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/pstring.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests assign operation from a Pascal-style counted-string. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + const wchar_t cs[] = L"aab"; + test_type re; + re.assign(cs, sizeof(cs)-1, std::tr1::regex_constants::basic); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/range.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/range.cc new file mode 100644 index 000000000..2ec474bc6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/range.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2009 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/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests range assign of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + wchar_t s[] = L"a+b|c"; + test_type re; + re.assign(s, s + 5); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/string.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/string.cc new file mode 100644 index 000000000..c5332a32c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/string.cc @@ -0,0 +1,43 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <string> +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests C++ string assignment of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + std::wstring s(L"a*b"); + test_type re; + re.assign(s); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/string_op.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/string_op.cc new file mode 100644 index 000000000..a19bd524a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/string_op.cc @@ -0,0 +1,43 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.3] class template basic_regex assign() + +#include <string> +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests basic_regex assignment operator from a C++ string; +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + std::wstring s(L"a*b"); + test_type re; + re = s; +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/cstring.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/cstring.cc new file mode 100644 index 000000000..9a160b09f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/cstring.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests C-style null-terminated-string constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + const char* cs = "aab"; + test_type re(cs); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/default.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/default.cc new file mode 100644 index 000000000..1797dbcb0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/default.cc @@ -0,0 +1,46 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests default constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + // default constructor + test_type re; + + // Check for required typedefs + typedef test_type::value_type value_type; + typedef test_type::flag_type flag_type; + typedef test_type::locale_type locale_type; +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/pstring.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/pstring.cc new file mode 100644 index 000000000..8315a59e2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/pstring.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests Pascal-style counted-string constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + const char* cs = "aab"; + test_type re(cs, 3, std::tr1::regex_constants::basic); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/range.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/range.cc new file mode 100644 index 000000000..0f09f6c69 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/range.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests range constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + char s[] = "a+b|c"; + test_type re(s, s + 5); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/string.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/string.cc new file mode 100644 index 000000000..16adebfe2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/string.cc @@ -0,0 +1,53 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <string> +#include <tr1/regex> +#include <testsuite_hooks.h> +#include <testsuite_allocator.h> + +// Tests C++ string constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<char> test_type; + + std::string s("a*b"); + test_type re(s); +} + +void test02() +{ + typedef std::tr1::basic_regex<char> test_type; + typedef __gnu_test::tracker_allocator<char> alloc_type; + + std::basic_string<char, std::char_traits<char>, alloc_type> s("a*b"); + test_type re(s); +} + +int +main() +{ + test01(); + test02(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/cstring.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/cstring.cc new file mode 100644 index 000000000..71ae03a0f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/cstring.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests C-style null-terminated-string constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + const wchar_t* cs = L"aab"; + test_type re(cs); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/default.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/default.cc new file mode 100644 index 000000000..06333e96a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/default.cc @@ -0,0 +1,46 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests default constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + // default constructor + test_type re; + + // Check for required typedefs + typedef test_type::value_type value_type; + typedef test_type::flag_type flag_type; + typedef test_type::locale_type locale_type; +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/pstring.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/pstring.cc new file mode 100644 index 000000000..9c8a7db8e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/pstring.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests Pascal-style counted-string constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + const wchar_t* cs = L"aab"; + test_type re(cs, 3, std::tr1::regex_constants::basic); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/range.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/range.cc new file mode 100644 index 000000000..ac45cdd17 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/range.cc @@ -0,0 +1,41 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests range constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + wchar_t s[] = L"a+b|c"; + test_type re(s, s + 5); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/string.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/string.cc new file mode 100644 index 000000000..83eddb033 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/string.cc @@ -0,0 +1,53 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.8.2] class template basic_regex constructor + +#include <string> +#include <tr1/regex> +#include <testsuite_hooks.h> +#include <testsuite_allocator.h> + +// Tests C++ string constructor of the basic_regex class. +void test01() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + + std::wstring s(L"a*b"); + test_type re(s); +} + +void test02() +{ + typedef std::tr1::basic_regex<wchar_t> test_type; + typedef __gnu_test::tracker_allocator<wchar_t> alloc_type; + + std::basic_string<wchar_t, std::char_traits<wchar_t>, alloc_type> s(L"a*b"); + test_type re(s); +} + +int +main() +{ + test01(); + test02(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/match_results/ctors/char/default.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/match_results/ctors/char/default.cc new file mode 100644 index 000000000..9c28a0c86 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/match_results/ctors/char/default.cc @@ -0,0 +1,57 @@ +// { dg-do link } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.10.1] class template match_results constructor + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests default constructor of the match_result class. +void test01() +{ + bool test __attribute__((unused)) = true; + typedef std::tr1::match_results<char*> test_type; + + // default constructor + test_type m; + + // Check for required typedefs + typedef test_type::value_type value_type; + typedef test_type::const_reference const_reference; + typedef test_type::reference reference; + typedef test_type::const_iterator const_iterator; + typedef test_type::iterator iterator; + typedef test_type::difference_type difference_type; + typedef test_type::size_type size_type; + typedef test_type::allocator_type allocator_type; + typedef test_type::char_type char_type; + typedef test_type::string_type string_type; + + VERIFY( m.size() == 0 ); + VERIFY( m.str() == std::basic_string<char_type>() ); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_awk.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_awk.cc new file mode 100644 index 000000000..be8b51b8c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_awk.cc @@ -0,0 +1,36 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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.8.2 basic_regex constructors + +#include <tr1/regex> + +void +test01() +{ + std::tr1::regex re("(a|b)*abb", std::tr1::regex::awk); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_basic.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_basic.cc new file mode 100644 index 000000000..0ea45c7d0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_basic.cc @@ -0,0 +1,36 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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.8.2 basic_regex constructors + +#include <tr1/regex> + +void +test01() +{ + std::tr1::regex re("(a|b)*abb", std::tr1::regex::basic); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_ecma.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_ecma.cc new file mode 100644 index 000000000..241cf6b0d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_ecma.cc @@ -0,0 +1,36 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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.8.2 basic_regex constructors + +#include <tr1/regex> + +void +test01() +{ + std::tr1::regex re("(a|b)*abb"); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_egrep.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_egrep.cc new file mode 100644 index 000000000..0a78af9c4 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_egrep.cc @@ -0,0 +1,36 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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.8.2 basic_regex constructors + +#include <tr1/regex> + +void +test01() +{ + std::tr1::regex re("(a|b)*abb", std::tr1::regex::egrep); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_extended.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_extended.cc new file mode 100644 index 000000000..899361d33 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_extended.cc @@ -0,0 +1,42 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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.8.2 basic_regex constructors + +#include <tr1/regex> +#include <testsuite_hooks.h> + +void +test01() +{ + bool test __attribute__((unused)) = true; + + std::tr1::regex re("(wee|week)(knights|night)", std::tr1::regex::extended); + + VERIFY( re.flags() == std::tr1::regex::extended ); + VERIFY( re.mark_count() == 0 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_grep.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_grep.cc new file mode 100644 index 000000000..5053294ab --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/c_string_grep.cc @@ -0,0 +1,38 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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.8.2 basic_regex constructors + +#include <tr1/regex> + +void +test01() +{ + using std::tr1::regex; + + regex re("(a|b)*abb", regex::grep); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/default.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/default.cc new file mode 100644 index 000000000..8b410652f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex/cons/char/default.cc @@ -0,0 +1,36 @@ +// { dg-do compile } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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.8.2 basic_regex constructors + +#include <tr1/regex> + +void +test01() +{ + std::tr1::regex re; +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/ctor.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/ctor.cc new file mode 100644 index 000000000..3f7552f55 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/ctor.cc @@ -0,0 +1,48 @@ +// { dg-do link } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.7] class template regex_traits + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests default constructor of the regex_traits class. There is only the +// default constructor. +void test01() +{ + typedef std::tr1::regex_traits<char> test_type; + + // required default constructor + test_type t; + + // Check for required typedefs + typedef test_type::char_type char_type; + typedef test_type::string_type string_type; + typedef test_type::locale_type locale_type; + typedef test_type::char_class_type char_class_type; +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/translate_nocase.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/translate_nocase.cc new file mode 100644 index 000000000..73fce8272 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/translate_nocase.cc @@ -0,0 +1,41 @@ +// { dg-do run } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.7] class template regex_traits (5) translate_nocase + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests default constructor of the regex_traits class. There is only the +// default constructor. +void test01() +{ + bool test __attribute__((unused)) = true; + std::tr1::regex_traits<char> t; + VERIFY( t.translate_nocase('A') == 'a' ); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/value.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/value.cc new file mode 100644 index 000000000..4f89afb61 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/char/value.cc @@ -0,0 +1,48 @@ +// { dg-do run } + +// 2008-08-11 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2008, 2009 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/>. + +// tr1 [7.7] class template regex_traits value() function + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests the value() function of the regex_traits<char> class. +void test01() +{ + bool test __attribute__((unused)) = true; + std::tr1::regex_traits<char> t; + VERIFY( t.value('7', 8) == 7 ); + VERIFY( t.value('7', 10) == 7 ); + VERIFY( t.value('7', 16) == 7 ); + VERIFY( t.value('9', 8) == -1 ); + VERIFY( t.value('9', 10) == 9 ); + VERIFY( t.value('9', 16) == 9 ); + VERIFY( t.value('d', 8) == -1 ); + VERIFY( t.value('d', 10) == -1 ); + VERIFY( t.value('d', 16) == 13 ); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/ctor.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/ctor.cc new file mode 100644 index 000000000..3c430ef4c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/ctor.cc @@ -0,0 +1,48 @@ +// { dg-do link } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.7] class template regex_traits + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests default constructor of the regex_traits class. There is only the +// default constructor. +void test01() +{ + typedef std::tr1::regex_traits<wchar_t> test_type; + + // required default constructor + test_type t; + + // Check for required typedefs + typedef test_type::char_type char_type; + typedef test_type::string_type string_type; + typedef test_type::locale_type locale_type; + typedef test_type::char_class_type char_class_type; +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/translate_nocase.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/translate_nocase.cc new file mode 100644 index 000000000..0404d0952 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/translate_nocase.cc @@ -0,0 +1,41 @@ +// { dg-do run } + +// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2007, 2009 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/>. + +// tr1 [7.7] class template regex_traits (5) translate_nocase + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests default constructor of the regex_traits class. There is only the +// default constructor. +void test01() +{ + bool test __attribute__((unused)) = true; + std::tr1::regex_traits<wchar_t> t; + VERIFY( t.translate_nocase(L'A') == L'a' ); +} + +int +main() +{ + test01(); + return 0; +}; diff --git a/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/value.cc b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/value.cc new file mode 100644 index 000000000..4f89afb61 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/7_regular_expressions/regex_traits/wchar_t/value.cc @@ -0,0 +1,48 @@ +// { dg-do run } + +// 2008-08-11 Stephen M. Webb <stephen.webb@bregmasoft.com> +// +// Copyright (C) 2008, 2009 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/>. + +// tr1 [7.7] class template regex_traits value() function + +#include <tr1/regex> +#include <testsuite_hooks.h> + +// Tests the value() function of the regex_traits<char> class. +void test01() +{ + bool test __attribute__((unused)) = true; + std::tr1::regex_traits<char> t; + VERIFY( t.value('7', 8) == 7 ); + VERIFY( t.value('7', 10) == 7 ); + VERIFY( t.value('7', 16) == 7 ); + VERIFY( t.value('9', 8) == -1 ); + VERIFY( t.value('9', 10) == 9 ); + VERIFY( t.value('9', 16) == 9 ); + VERIFY( t.value('d', 8) == -1 ); + VERIFY( t.value('d', 10) == -1 ); + VERIFY( t.value('d', 16) == 13 ); +} + +int +main() +{ + test01(); + return 0; +}; |