|
|
56505a |
From 8a7f364afd86a4c4c2c747ae9cb4216fe992acc8 Mon Sep 17 00:00:00 2001
|
|
|
56505a |
From: David Malcolm <dmalcolm@redhat.com>
|
|
|
56505a |
Date: Wed, 25 Aug 2021 12:36:42 -0400
|
|
|
56505a |
Subject: [PATCH 01/17] basic_string::reserve(n) semantics are not available in
|
|
|
56505a |
DTS
|
|
|
56505a |
|
|
|
56505a |
Various tests were added upstream 2020-08-06 as part of:
|
|
|
56505a |
"libstdc++: Implement P0966 std::string::reserve should not shrink"
|
|
|
56505a |
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=140cf935cd118f7208b7c3826a8b9d50936242f0
|
|
|
56505a |
|
|
|
56505a |
std::string and std::wstring are instantiated in the system libstdc++.so
|
|
|
56505a |
via explicit instantiation definitions, so the new basic_string::reserve(n)
|
|
|
56505a |
semantics are not available in DTS.
|
|
|
56505a |
|
|
|
56505a |
Update/disable the pertinent parts of the tests to reflect the behavior
|
|
|
56505a |
when run against the system libstdc++.so.
|
|
|
56505a |
---
|
|
|
56505a |
.../testsuite/21_strings/basic_string/capacity/char/1.cc | 6 ------
|
|
|
56505a |
.../21_strings/basic_string/capacity/char/18654.cc | 2 +-
|
|
|
56505a |
.../testsuite/21_strings/basic_string/capacity/wchar_t/1.cc | 6 ------
|
|
|
56505a |
.../21_strings/basic_string/capacity/wchar_t/18654.cc | 2 +-
|
|
|
56505a |
4 files changed, 2 insertions(+), 14 deletions(-)
|
|
|
56505a |
|
|
|
56505a |
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc
|
|
|
56505a |
index eea69771f..64187718d 100644
|
|
|
56505a |
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc
|
|
|
56505a |
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc
|
|
|
56505a |
@@ -41,12 +41,6 @@ void test01()
|
|
|
56505a |
sz01 = str01.capacity();
|
|
|
56505a |
VERIFY( sz01 < sz02 );
|
|
|
56505a |
|
|
|
56505a |
- // P0966: reserve should not shrink
|
|
|
56505a |
- str01.reserve(100);
|
|
|
56505a |
- sz01 = str01.capacity();
|
|
|
56505a |
- str01.reserve(sz01 - 1);
|
|
|
56505a |
- VERIFY( str01.capacity() == sz01 );
|
|
|
56505a |
-
|
|
|
56505a |
sz01 = str01.size() + 5;
|
|
|
56505a |
str01.resize(sz01);
|
|
|
56505a |
sz02 = str01.size();
|
|
|
56505a |
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc
|
|
|
56505a |
index 02ce78ea6..3a7352123 100644
|
|
|
56505a |
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc
|
|
|
56505a |
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc
|
|
|
56505a |
@@ -51,7 +51,7 @@ void test01()
|
|
|
56505a |
VERIFY( cap >= 3 * i );
|
|
|
56505a |
|
|
|
56505a |
str.reserve(2 * i);
|
|
|
56505a |
- VERIFY( str.capacity() == cap );
|
|
|
56505a |
+ VERIFY( str.capacity() == 2 * i );
|
|
|
56505a |
|
|
|
56505a |
#if __cplusplus <= 201703L
|
|
|
56505a |
str.reserve();
|
|
|
56505a |
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc
|
|
|
56505a |
index f01a27e8c..70915a94d 100644
|
|
|
56505a |
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc
|
|
|
56505a |
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc
|
|
|
56505a |
@@ -41,12 +41,6 @@ void test01()
|
|
|
56505a |
sz01 = str01.capacity();
|
|
|
56505a |
VERIFY( sz01 < sz02 );
|
|
|
56505a |
|
|
|
56505a |
- // P0966: reserve should not shrink
|
|
|
56505a |
- str01.reserve(100);
|
|
|
56505a |
- sz01 = str01.capacity();
|
|
|
56505a |
- str01.reserve(sz01 - 1);
|
|
|
56505a |
- VERIFY( str01.capacity() == sz01 );
|
|
|
56505a |
-
|
|
|
56505a |
sz01 = str01.size() + 5;
|
|
|
56505a |
str01.resize(sz01);
|
|
|
56505a |
sz02 = str01.size();
|
|
|
56505a |
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc
|
|
|
56505a |
index 267fd198b..c9711a294 100644
|
|
|
56505a |
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc
|
|
|
56505a |
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc
|
|
|
56505a |
@@ -51,7 +51,7 @@ void test01()
|
|
|
56505a |
VERIFY( cap >= 3 * i );
|
|
|
56505a |
|
|
|
56505a |
str.reserve(2 * i);
|
|
|
56505a |
- VERIFY( str.capacity() == cap );
|
|
|
56505a |
+ VERIFY( str.capacity() == 2 * i );
|
|
|
56505a |
|
|
|
56505a |
#if __cplusplus <= 201703L
|
|
|
56505a |
str.reserve();
|
|
|
56505a |
--
|
|
|
56505a |
2.31.1
|