Skip to content

Commit 5c852fc

Browse files
authored
[libc++][C++03] Fix a bunch of random tests (llvm#144117)
This fixes/removes a bunch of random tests. They all failed in relatively simple to fix ways. Specificially (all inside `libcxx/test/libcxx-03`): - `utilities/template.bitset/includes.pass.cpp`: the header guards have different names now (guard names fixed) - `utilities/meta/is_referenceable.compile.pass.cpp`: The name changed from `__libcpp_is_referenceable` (reverted name) - `utilities/function.objects/refwrap/desugars_to.compile.pass.cpp`: Optimization has been added after the header split (test removed) - `type_traits/is_replaceable.compile.pass.cpp`: `__is_replacable_v` has been added after the header split (test removed) - `type_traits/is_constant_evaluated.pass.cpp`: Ran C++11 code accidentally (C++11 test parts removed) - `type_traits/desugars_to.compile.pass.cpp`: Optimization has been added after the header split (test removed) - `numerics/bit.ops.pass.cpp`: Tried to include header which doesn't exist (removed include and related code which wasn't executed in C++03) - `experimental/fexperimental-library.compile.pass.cpp`: This test is irrelevant for C++03, since there are no C++03 experimental features (test removed) - `containers/container_traits.compile.pass.cpp`: `container_traits` have been introduced after the header split (test removed)
1 parent 884c03e commit 5c852fc

File tree

8 files changed

+118
-692
lines changed

8 files changed

+118
-692
lines changed

libcxx/test/libcxx-03/containers/container_traits.compile.pass.cpp

Lines changed: 0 additions & 165 deletions
This file was deleted.

libcxx/test/libcxx-03/iterators/bounded_iter/comparison.pass.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
//
1212
// Comparison operators
1313

14-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
15-
1614
#include <concepts>
17-
#include <__iterator/bounded_iter.h>
15+
#include <__cxx03/__iterator/bounded_iter.h>
1816

1917
#include "test_iterators.h"
2018
#include "test_macros.h"

libcxx/test/libcxx-03/numerics/bit.ops.pass.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
// Test the __XXXX routines in the <bit> header.
1010
// These are not supposed to be exhaustive tests, just sanity checks.
1111

12-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
13-
14-
#include <__bit/bit_log2.h>
15-
#include <__bit/countl.h>
16-
#include <__bit/rotate.h>
12+
#include <__cxx03/__bit/countl.h>
13+
#include <__cxx03/__bit/rotate.h>
1714
#include <cassert>
1815

1916
#include "test_macros.h"
@@ -27,11 +24,6 @@ TEST_CONSTEXPR_CXX14 bool test() {
2724
assert(std::__rotr(v, 3) == 0x02468acfU);
2825
assert(std::__countl_zero(v) == 3);
2926

30-
#if TEST_STD_VER > 17
31-
ASSERT_SAME_TYPE(unsigned, decltype(std::__bit_log2(v)));
32-
assert(std::__bit_log2(v) == 28);
33-
#endif
34-
3527
return true;
3628
}
3729

libcxx/test/libcxx-03/type_traits/desugars_to.compile.pass.cpp

Lines changed: 0 additions & 42 deletions
This file was deleted.

libcxx/test/libcxx-03/type_traits/is_constant_evaluated.pass.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
// returns false when there's no constant evaluation support from the compiler.
1515
// as well as when called not in a constexpr context
1616

17-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
18-
19-
#include <__type_traits/is_constant_evaluated.h>
17+
#include <__cxx03/__type_traits/is_constant_evaluated.h>
2018
#include <cassert>
2119

2220
#include "test_macros.h"
@@ -25,10 +23,6 @@ int main (int, char**) {
2523
ASSERT_SAME_TYPE(decltype(std::__libcpp_is_constant_evaluated()), bool);
2624
ASSERT_NOEXCEPT(std::__libcpp_is_constant_evaluated());
2725

28-
#if !defined(_LIBCPP_CXX03_LANG)
29-
static_assert(std::__libcpp_is_constant_evaluated(), "");
30-
#endif
31-
3226
bool p = std::__libcpp_is_constant_evaluated();
3327
assert(!p);
3428

0 commit comments

Comments
 (0)