Skip to content

[libc++][C++03] Fix tests that are failing due to private includes #139900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions libcxx/test/libcxx/algorithms/half_positive.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
// __half_positive divides an integer number by 2 as unsigned number for known types.
// It can be an important optimization for lower bound, for example.

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__algorithm/half_positive.h>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__algorithm/half_positive.h)
#include <cassert>
#include <cstddef>
#include <limits>

#include "test_macros.h"
#include "user_defined_integral.h"

namespace {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
// We don't know how to vectorize algorithms on GCC
// XFAIL: gcc

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

// We don't vectorize algorithms before C++14
// XFAIL: c++03, c++11

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// failures when back-deploying.
// XFAIL: availability-verbose_abort-missing

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__verbose_abort>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__verbose_abort)
#include <cstdlib>

void std::__libcpp_verbose_abort(char const*, ...) _NOEXCEPT { std::exit(EXIT_SUCCESS); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
// Test that the default verbose termination function aborts the program.
// XFAIL: availability-verbose_abort-missing

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__verbose_abort>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__verbose_abort)
#include <csignal>
#include <cstdlib>

Expand Down
4 changes: 2 additions & 2 deletions libcxx/test/libcxx/assertions/modes/none.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

// REQUIRES: libcpp-hardening-mode=none

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__assert>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__assert)
#include <cassert>

bool executed_condition = false;
Expand Down
4 changes: 2 additions & 2 deletions libcxx/test/libcxx/assertions/single_expression.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
// This is useful so we can use them in places that require an expression, such as
// in a constructor initializer list.

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__assert>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__assert)
#include <cassert>

void f() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
// void
// __tree_balance_after_insert(_NodePtr __root, _NodePtr __x)

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__tree>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__tree)
#include <cassert>

#include "test_macros.h"

struct Node {
Node* __left_;
Node* __right_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
//
//===----------------------------------------------------------------------===//

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__tree>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__tree)
#include <map>
#include <set>
#include <type_traits>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
// void
// __tree_left_rotate(_NodePtr __x);

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__tree>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__tree)
#include <cassert>

#include "test_macros.h"

struct Node {
Node* __left_;
Node* __right_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
// void
// __tree_remove(_NodePtr __root, _NodePtr __z)

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__tree>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__tree)
#include <cassert>

#include "test_macros.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
// void
// __tree_right_rotate(_NodePtr __x);

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__tree>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__tree)
#include <cassert>

#include "test_macros.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
// <__type_traits/container_traits.h>
//

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__type_traits/container_traits.h>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__type_traits/container_traits.h)

#include <deque>
#include <forward_list>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@
//
//===----------------------------------------------------------------------===//

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__hash_table>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__hash_table)
#include <unordered_map>
#include <unordered_set>
#include <type_traits>

#include "test_macros.h"
#include "min_allocator.h"

void testKeyValueTrait() {
{
typedef int Tp;
Expand Down
6 changes: 2 additions & 4 deletions libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@
// If n <= 1, return n. If n is a power of 2, return n.
// Otherwise, return the next power of 2.

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__hash_table>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__hash_table)
#include <cassert>
#include <cstdint>
#include <unordered_map>

#include "test_macros.h"

bool is_power_of_two(unsigned long n) { return __builtin_popcount(n) == 1; }

void test_next_pow2_val(std::size_t n) {
Expand Down
4 changes: 2 additions & 2 deletions libcxx/test/libcxx/containers/unord/next_prime.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

// If n == 0, return 0, else return the lowest prime greater than or equal to n

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__hash_table>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__hash_table)
#include <cassert>
#include <cstddef>

Expand Down
4 changes: 1 addition & 3 deletions libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
// that we don't want to support and can't support with LSV enabled.
// UNSUPPORTED: clang-modules-build

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

// Sometimes C++'s <foo.h> headers get included within extern "C" contexts. This
// is ill-formed (no diagnostic required), per [using.headers]p3, but we permit
// it as an extension.

#include <__config>
#include <version>

extern "C" {
#include <assert.h>
Expand Down
4 changes: 2 additions & 2 deletions libcxx/test/libcxx/iterators/aliasing_iterator.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

// ADDITIONAL_COMPILE_FLAGS(clang): -Wprivate-header

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__iterator/aliasing_iterator.h>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__iterator/aliasing_iterator.h)
#include <cassert>

struct NonTrivial {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
//
// Arithmetic operators

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__iterator/bounded_iter.h>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__iterator/bounded_iter.h)
#include <cstddef>

#include "test_iterators.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
//
// Comparison operators

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <concepts>
#include <__iterator/bounded_iter.h>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__iterator/bounded_iter.h)

#include "test_iterators.h"
#include "test_macros.h"

template <class Iter>
TEST_CONSTEXPR_CXX14 bool tests() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
//
// std::pointer_traits specialization

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__iterator/bounded_iter.h>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__iterator/bounded_iter.h)
#include <cassert>
#include <cstddef>
#include <memory>
#include <type_traits>

#include "test_iterators.h"
#include "test_macros.h"

template <class Iter>
TEST_CONSTEXPR_CXX14 bool tests() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
//
// Nested types

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__iterator/bounded_iter.h>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__iterator/bounded_iter.h)
#include <cstddef>
#include <iterator>
#include <type_traits>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
// GCC doesn't support the aligned-allocation flags.
// XFAIL: gcc

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

// RUN: %{build} -faligned-allocation -fsized-deallocation
// RUN: %{run}
// RUN: %{build} -faligned-allocation -fno-sized-deallocation -DNO_SIZE
Expand All @@ -32,16 +30,15 @@
// RUN: %{build} -fno-aligned-allocation -fno-sized-deallocation -DNO_ALIGN -DNO_SIZE
// RUN: %{run}

// ADDITIONAL_COMPILE_FLAGS: -Wprivate-header

#include <cassert>
#include <cstdlib>
#include <new>

#include "test_macros.h"

TEST_DIAGNOSTIC_PUSH
TEST_CLANG_DIAGNOSTIC_IGNORED("-Wprivate-header")
#include <__memory/aligned_alloc.h>
TEST_DIAGNOSTIC_POP
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__memory/aligned_alloc.h)

struct alloc_stats {
alloc_stats() { reset(); }
Expand Down
6 changes: 3 additions & 3 deletions libcxx/test/libcxx/memory/allocation_guard.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// To allow checking that self-move works correctly.
// ADDITIONAL_COMPILE_FLAGS: -Wno-self-move

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

// template<class _Alloc>
// struct __allocation_guard;

#include <__memory/allocation_guard.h>
#include "test_macros.h"

#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__memory/allocation_guard.h)
#include <cassert>
#include <type_traits>
#include <utility>
Expand Down
6 changes: 3 additions & 3 deletions libcxx/test/libcxx/memory/swap_allocator.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
//===----------------------------------------------------------------------===//
//

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

// <memory>

// template <typename _Alloc>
// void __swap_allocator(_Alloc& __a1, _Alloc& __a2);

#include <__memory/swap_allocator.h>
#include "test_macros.h"

#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__memory/swap_allocator.h)
#include <cassert>
#include <memory>
#include <utility>
Expand Down
10 changes: 4 additions & 6 deletions libcxx/test/libcxx/numerics/bit.ops.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@
// Test the __XXXX routines in the <bit> header.
// These are not supposed to be exhaustive tests, just sanity checks.

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__bit/bit_log2.h>
#include <__bit/countl.h>
#include <__bit/rotate.h>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__bit/bit_log2.h)
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__bit/countl.h)
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__bit/rotate.h)
#include <cassert>

#include "test_macros.h"

TEST_CONSTEXPR_CXX14 bool test() {
const unsigned v = 0x12345678;

Expand Down
4 changes: 2 additions & 2 deletions libcxx/test/libcxx/numerics/clamp_to_integral.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// closest representable value for the specified integer type, or
// numeric_limits<IntT>::max()/min() if the value isn't representable.

// XFAIL: FROZEN-CXX03-HEADERS-FIXME
#include "test_macros.h"

#include <__random/clamp_to_integral.h>
#include TEST_LIBCPP_INTERNAL_POSSIBLY_FROZEN_INCLUDE(__random/clamp_to_integral.h)
#include <cassert>
#include <cmath>
#include <limits>
Expand Down
4 changes: 1 addition & 3 deletions libcxx/test/libcxx/selftest/test_macros.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
//
// Test the "test_macros.h" header.

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

#include <__config>
#include <version>
#include "test_macros.h"

#ifndef TEST_STD_VER
Expand Down
Loading
Loading