Skip to content

Commit 486e2ce

Browse files
committed
[libc++][C++03] Fix support.dynamic/libcpp_deallocate.sh.cpp
This basically reverts the test changes in #118837.
1 parent 782a91e commit 486e2ce

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

libcxx/test/libcxx-03/language.support/support.dynamic/libcpp_deallocate.sh.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
// GCC doesn't support the aligned-allocation flags.
2222
// XFAIL: gcc
2323

24-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
25-
2624
// RUN: %{build} -faligned-allocation -fsized-deallocation
2725
// RUN: %{run}
2826
// RUN: %{build} -faligned-allocation -fno-sized-deallocation -DNO_SIZE
@@ -40,7 +38,7 @@
4038

4139
TEST_DIAGNOSTIC_PUSH
4240
TEST_CLANG_DIAGNOSTIC_IGNORED("-Wprivate-header")
43-
#include <__memory/aligned_alloc.h>
41+
#include <__cxx03/__memory/aligned_alloc.h>
4442
TEST_DIAGNOSTIC_POP
4543

4644
struct alloc_stats {
@@ -138,42 +136,42 @@ void test_libcpp_dealloc() {
138136
std::size_t with_size_val = 2;
139137

140138
{
141-
std::__libcpp_deallocate_unsized<char>(static_cast<char*>(p), under_align_val);
139+
std::__libcpp_deallocate_unsized(p, under_align_val);
142140
assert(stats.expect_plain());
143141
}
144142
stats.reset();
145143

146144
#if defined(NO_SIZE) && defined(NO_ALIGN)
147145
{
148-
std::__libcpp_deallocate<char>(static_cast<char*>(p), std::__element_count(with_size_val), over_align_val);
146+
std::__libcpp_deallocate(p, with_size_val, over_align_val);
149147
assert(stats.expect_plain());
150148
}
151149
stats.reset();
152150
#elif defined(NO_SIZE)
153151
{
154-
std::__libcpp_deallocate<char>(static_cast<char*>(p), std::__element_count(with_size_val), over_align_val);
152+
std::__libcpp_deallocate(p, with_size_val, over_align_val);
155153
assert(stats.expect_align(over_align_val));
156154
}
157155
stats.reset();
158156
#elif defined(NO_ALIGN)
159157
{
160-
std::__libcpp_deallocate<char>(static_cast<char*>(p), std::__element_count(with_size_val), over_align_val);
158+
std::__libcpp_deallocate(p, with_size_val, over_align_val);
161159
assert(stats.expect_size(with_size_val));
162160
}
163161
stats.reset();
164162
#else
165163
{
166-
std::__libcpp_deallocate<char>(static_cast<char*>(p), std::__element_count(with_size_val), over_align_val);
164+
std::__libcpp_deallocate(p, with_size_val, over_align_val);
167165
assert(stats.expect_size_align(with_size_val, over_align_val));
168166
}
169167
stats.reset();
170168
{
171-
std::__libcpp_deallocate_unsized<char>(static_cast<char*>(p), over_align_val);
169+
std::__libcpp_deallocate_unsized(p, over_align_val);
172170
assert(stats.expect_align(over_align_val));
173171
}
174172
stats.reset();
175173
{
176-
std::__libcpp_deallocate<char>(static_cast<char*>(p), std::__element_count(with_size_val), under_align_val);
174+
std::__libcpp_deallocate(p, with_size_val, under_align_val);
177175
assert(stats.expect_size(with_size_val));
178176
}
179177
stats.reset();

0 commit comments

Comments
 (0)