aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2010-05-31 14:14:42 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2010-05-31 14:14:42 +0000
commit1e2c0906eeaf6050034a17d06c9d40c16a3f29cd (patch)
tree7e03ee0ccbc4d0692ccc1eb272a0551cde8653f2 /libstdc++-v3/testsuite
parent877a19bfb8f34344702b206a549c61f7466fdf01 (diff)
downloadgcc-1e2c0906eeaf6050034a17d06c9d40c16a3f29cd.zip
gcc-1e2c0906eeaf6050034a17d06c9d40c16a3f29cd.tar.gz
gcc-1e2c0906eeaf6050034a17d06c9d40c16a3f29cd.tar.bz2
basic_string.h (front, back): Add.
2010-05-31 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/basic_string.h (front, back): Add. * include/debug/string: Adjust. * include/ext/vstring.h (front, back): Tweak the implementation to follow more closely the letter of the specs. * testsuite/21_strings/basic_string/element_access/char/ front_back.cc: New. * testsuite/21_strings/basic_string/element_access/wchar_t/ front_back.cc: Likewise. * config/abi/pre/gnu.ver: Export new symbols. * testsuite/util/testsuite_abi.cc: Adjust. * configure.ac: Bump minor version to 6:15:0. * configure: Regenerate. From-SVN: r160071
Diffstat (limited to 'libstdc++-v3/testsuite')
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/front_back.cc43
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/front_back.cc43
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_abi.cc4
3 files changed, 89 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/front_back.cc b/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/front_back.cc
new file mode 100644
index 0000000..a7c1386
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/front_back.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-string-conversions "" }
+
+// 2010-05-31 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation
+//
+// 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 <string>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::string str("ramifications");
+ const std::string cstr("melodien");
+
+ VERIFY( str.front() == 'r' );
+ VERIFY( str.back() == 's' );
+ VERIFY( cstr.front() == 'm' );
+ VERIFY( cstr.back() == 'n' );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/front_back.cc b/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/front_back.cc
new file mode 100644
index 0000000..60b0960
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/front_back.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-string-conversions "" }
+
+// 2010-05-31 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation
+//
+// 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 <string>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::wstring str(L"ramifications");
+ const std::wstring cstr(L"melodien");
+
+ VERIFY( str.front() == L'r' );
+ VERIFY( str.back() == L's' );
+ VERIFY( cstr.front() == L'm' );
+ VERIFY( cstr.back() == L'n' );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/util/testsuite_abi.cc b/libstdc++-v3/testsuite/util/testsuite_abi.cc
index c7166c6..d3c73f6 100644
--- a/libstdc++-v3/testsuite/util/testsuite_abi.cc
+++ b/libstdc++-v3/testsuite/util/testsuite_abi.cc
@@ -1,6 +1,7 @@
// -*- C++ -*-
-// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+// Free Software Foundation, Inc.
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
@@ -186,6 +187,7 @@ check_version(symbol& test, bool added)
known_versions.push_back("GLIBCXX_3.4.12");
known_versions.push_back("GLIBCXX_3.4.13");
known_versions.push_back("GLIBCXX_3.4.14");
+ known_versions.push_back("GLIBCXX_3.4.15");
known_versions.push_back("GLIBCXX_LDBL_3.4");
known_versions.push_back("GLIBCXX_LDBL_3.4.7");
known_versions.push_back("GLIBCXX_LDBL_3.4.10");