summaryrefslogtreecommitdiff
path: root/libcxx/test/std/strings/basic.string
diff options
context:
space:
mode:
authorMichael Kruse <llvm-project@meinersbur.de>2025-01-03 10:22:51 +0100
committerMichael Kruse <llvm-project@meinersbur.de>2025-01-03 10:22:51 +0100
commit38500d63e14ce340236840f60d356cdefb56a52c (patch)
tree17edbec446ce9b50d2f215a483b83afb293a635d /libcxx/test/std/strings/basic.string
parent1a3d5daaef7a6a63448a497da3eff7fc9e23df26 (diff)
parent27f30029741ecf023baece7b3dde1ff9011ffefc (diff)
Merge branch 'main' into users/meinersbur/flang_runtime_split-headersusers/meinersbur/flang_runtime_split-headers
Diffstat (limited to 'libcxx/test/std/strings/basic.string')
-rw-r--r--libcxx/test/std/strings/basic.string/char.bad.verify.cpp2
-rw-r--r--libcxx/test/std/strings/basic.string/string.capacity/shrink_to_fit.pass.cpp31
2 files changed, 6 insertions, 27 deletions
diff --git a/libcxx/test/std/strings/basic.string/char.bad.verify.cpp b/libcxx/test/std/strings/basic.string/char.bad.verify.cpp
index bedc5f19a6a8..c206c1ce8df4 100644
--- a/libcxx/test/std/strings/basic.string/char.bad.verify.cpp
+++ b/libcxx/test/std/strings/basic.string/char.bad.verify.cpp
@@ -9,6 +9,8 @@
// <string>
// ... manipulating sequences of any non-array trivial standard-layout types.
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
+
#include <string>
#include "test_traits.h"
diff --git a/libcxx/test/std/strings/basic.string/string.capacity/shrink_to_fit.pass.cpp b/libcxx/test/std/strings/basic.string/string.capacity/shrink_to_fit.pass.cpp
index 6f5e43d1341f..2d901e7afe2b 100644
--- a/libcxx/test/std/strings/basic.string/string.capacity/shrink_to_fit.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.capacity/shrink_to_fit.pass.cpp
@@ -10,12 +10,13 @@
// void shrink_to_fit(); // constexpr since C++20
-#include <string>
#include <cassert>
+#include <string>
-#include "test_macros.h"
-#include "min_allocator.h"
#include "asan_testing.h"
+#include "increasing_allocator.h"
+#include "min_allocator.h"
+#include "test_macros.h"
template <class S>
TEST_CONSTEXPR_CXX20 void test(S s) {
@@ -64,30 +65,6 @@ TEST_CONSTEXPR_CXX20 bool test() {
}
#if TEST_STD_VER >= 23
-std::size_t min_bytes = 1000;
-
-template <typename T>
-struct increasing_allocator {
- using value_type = T;
- increasing_allocator() = default;
- template <typename U>
- increasing_allocator(const increasing_allocator<U>&) noexcept {}
- std::allocation_result<T*> allocate_at_least(std::size_t n) {
- std::size_t allocation_amount = n * sizeof(T);
- if (allocation_amount < min_bytes)
- allocation_amount = min_bytes;
- min_bytes += 1000;
- return {static_cast<T*>(::operator new(allocation_amount)), allocation_amount / sizeof(T)};
- }
- T* allocate(std::size_t n) { return allocate_at_least(n).ptr; }
- void deallocate(T* p, std::size_t) noexcept { ::operator delete(static_cast<void*>(p)); }
-};
-
-template <typename T, typename U>
-bool operator==(increasing_allocator<T>, increasing_allocator<U>) {
- return true;
-}
-
// https://github.com/llvm/llvm-project/issues/95161
void test_increasing_allocator() {
std::basic_string<char, std::char_traits<char>, increasing_allocator<char>> s{