diff --git a/libcxx/test/libcxx/double_include.sh.cpp b/libcxx/test/libcxx/double_include.sh.cpp --- a/libcxx/test/libcxx/double_include.sh.cpp +++ b/libcxx/test/libcxx/double_include.sh.cpp @@ -1,235 +1,235 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Test that we can include each header in two TU's and link them together. - -// RUN: %{cxx} -c %s -o %t.first.o %{flags} %{compile_flags} -// RUN: %{cxx} -c %s -o %t.second.o -DWITH_MAIN %{flags} %{compile_flags} -// RUN: %{cxx} -o %t.exe %t.first.o %t.second.o %{flags} %{link_flags} -// RUN: %{run} - -// GCC 5 pretends it supports C++17 features, but some features like static_assert -// without a message are not actually supported. This causes some headers to fail -// when included. -// UNSUPPORTED: gcc-5 && c++17 - -// Prevent from generating deprecated warnings for this test. -#if defined(__DEPRECATED) -# undef __DEPRECATED -#endif - -//////////////////////////////////////////////////////////////////////////////// -// BEGIN-GENERATED-HEADERS -//////////////////////////////////////////////////////////////////////////////// - -// clang-format off - -// WARNING: This test was generated by generate_header_tests.py -// and should not be edited manually. - -// Top level headers -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif -#include -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif -#include -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif -#include -#include -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#include -#include -#include -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#include -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// experimental headers -#if __cplusplus >= 201103L -# include -# if defined(__cpp_coroutines) -# include -# endif -# include -# include -# include -# include -# include -# include -# include -# include -# include -# ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -# endif -# include -# include -# include -# include -# include -# include -# include -# include -#endif // __cplusplus >= 201103L - -// extended headers -#include -#include - -// clang-format on - -//////////////////////////////////////////////////////////////////////////////// -// END-GENERATED-HEADERS -//////////////////////////////////////////////////////////////////////////////// - -#if defined(WITH_MAIN) -int main(int, char**) { return 0; } -#endif +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// Test that we can include each header in two TU's and link them together. + +// RUN: %{cxx} -c %s -o %t.first.o %{flags} %{compile_flags} +// RUN: %{cxx} -c %s -o %t.second.o -DWITH_MAIN %{flags} %{compile_flags} +// RUN: %{cxx} -o %t.exe %t.first.o %t.second.o %{flags} %{link_flags} +// RUN: %{run} + +// GCC 5 pretends it supports C++17 features, but some features like static_assert +// without a message are not actually supported. This causes some headers to fail +// when included. +// UNSUPPORTED: gcc-5 && c++17 + +// Prevent from generating deprecated warnings for this test. +#if defined(__DEPRECATED) +# undef __DEPRECATED +#endif + +//////////////////////////////////////////////////////////////////////////////// +// BEGIN-GENERATED-HEADERS +//////////////////////////////////////////////////////////////////////////////// + +// clang-format off + +// WARNING: This test was generated by generate_header_tests.py +// and should not be edited manually. + +// Top level headers +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_THREADS +# include +#endif +#ifndef _LIBCPP_HAS_NO_THREADS +# include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#ifndef _LIBCPP_HAS_NO_THREADS +# include +#endif +#include +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#ifndef _LIBCPP_HAS_NO_THREADS +# include +#endif +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_THREADS +# include +#endif +#include +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#ifndef _LIBCPP_HAS_NO_THREADS +# include +#endif +#include +#include +#ifndef _LIBCPP_HAS_NO_THREADS +# include +#endif +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#include +#include +#include +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#include +#ifndef _LIBCPP_HAS_NO_THREADS +# include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// experimental headers +#if __cplusplus >= 201103L +# include +# if defined(__cpp_coroutines) +# include +# endif +# include +# include +# include +# include +# include +# include +# include +# include +# include +# ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +# endif +# include +# include +# include +# include +# include +# include +# include +# include +#endif // __cplusplus >= 201103L + +// extended headers +#include +#include + +// clang-format on + +//////////////////////////////////////////////////////////////////////////////// +// END-GENERATED-HEADERS +//////////////////////////////////////////////////////////////////////////////// + +#if defined(WITH_MAIN) +int main(int, char**) { return 0; } +#endif diff --git a/libcxx/test/libcxx/min_max_macros.compile.pass.cpp b/libcxx/test/libcxx/min_max_macros.compile.pass.cpp --- a/libcxx/test/libcxx/min_max_macros.compile.pass.cpp +++ b/libcxx/test/libcxx/min_max_macros.compile.pass.cpp @@ -1,364 +1,364 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Test that headers are not tripped up by the surrounding code defining the -// min() and max() macros. - -// GCC 5 has incomplete support for C++17, so some headers fail when included. -// UNSUPPORTED: gcc-5 && c++17 - -// Prevent from generating deprecated warnings for this test. -#if defined(__DEPRECATED) -# undef __DEPRECATED -#endif - -#define TEST_MACROS() static_assert(min() == true && max() == true, "") -#define min() true -#define max() true - -//////////////////////////////////////////////////////////////////////////////// -// BEGIN-GENERATED-HEADERS -//////////////////////////////////////////////////////////////////////////////// - -// clang-format off - -// WARNING: This test was generated by generate_header_tests.py -// and should not be edited manually. - -// Top level headers -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_THREADS -# include -TEST_MACROS(); -#endif -#ifndef _LIBCPP_HAS_NO_THREADS -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_THREADS -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -TEST_MACROS(); -#endif -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -TEST_MACROS(); -#endif -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_THREADS -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -TEST_MACROS(); -#endif -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_THREADS -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_THREADS -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_THREADS -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#ifndef _LIBCPP_HAS_NO_THREADS -# include -TEST_MACROS(); -#endif -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); -#include -TEST_MACROS(); - -// experimental headers -#if __cplusplus >= 201103L -# include -TEST_MACROS(); -# if defined(__cpp_coroutines) -# include -TEST_MACROS(); -# endif -# include -TEST_MACROS(); -# include -TEST_MACROS(); -# include -TEST_MACROS(); -# include -TEST_MACROS(); -# include -TEST_MACROS(); -# include -TEST_MACROS(); -# include -TEST_MACROS(); -# include -TEST_MACROS(); -# include -TEST_MACROS(); -# ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -TEST_MACROS(); -# endif -# include -TEST_MACROS(); -# include -TEST_MACROS(); -# include -TEST_MACROS(); -# include -TEST_MACROS(); -# include -TEST_MACROS(); -# include -TEST_MACROS(); -# include -TEST_MACROS(); -# include -TEST_MACROS(); -#endif // __cplusplus >= 201103L - -// extended headers -#include -TEST_MACROS(); -#include -TEST_MACROS(); - -// clang-format on - -//////////////////////////////////////////////////////////////////////////////// -// END-GENERATED-HEADERS -//////////////////////////////////////////////////////////////////////////////// +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// Test that headers are not tripped up by the surrounding code defining the +// min() and max() macros. + +// GCC 5 has incomplete support for C++17, so some headers fail when included. +// UNSUPPORTED: gcc-5 && c++17 + +// Prevent from generating deprecated warnings for this test. +#if defined(__DEPRECATED) +# undef __DEPRECATED +#endif + +#define TEST_MACROS() static_assert(min() == true && max() == true, "") +#define min() true +#define max() true + +//////////////////////////////////////////////////////////////////////////////// +// BEGIN-GENERATED-HEADERS +//////////////////////////////////////////////////////////////////////////////// + +// clang-format off + +// WARNING: This test was generated by generate_header_tests.py +// and should not be edited manually. + +// Top level headers +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_THREADS +# include +TEST_MACROS(); +#endif +#ifndef _LIBCPP_HAS_NO_THREADS +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_THREADS +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +TEST_MACROS(); +#endif +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +TEST_MACROS(); +#endif +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_THREADS +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +TEST_MACROS(); +#endif +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_THREADS +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_THREADS +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_THREADS +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#ifndef _LIBCPP_HAS_NO_THREADS +# include +TEST_MACROS(); +#endif +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); +#include +TEST_MACROS(); + +// experimental headers +#if __cplusplus >= 201103L +# include +TEST_MACROS(); +# if defined(__cpp_coroutines) +# include +TEST_MACROS(); +# endif +# include +TEST_MACROS(); +# include +TEST_MACROS(); +# include +TEST_MACROS(); +# include +TEST_MACROS(); +# include +TEST_MACROS(); +# include +TEST_MACROS(); +# include +TEST_MACROS(); +# include +TEST_MACROS(); +# include +TEST_MACROS(); +# ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +TEST_MACROS(); +# endif +# include +TEST_MACROS(); +# include +TEST_MACROS(); +# include +TEST_MACROS(); +# include +TEST_MACROS(); +# include +TEST_MACROS(); +# include +TEST_MACROS(); +# include +TEST_MACROS(); +# include +TEST_MACROS(); +#endif // __cplusplus >= 201103L + +// extended headers +#include +TEST_MACROS(); +#include +TEST_MACROS(); + +// clang-format on + +//////////////////////////////////////////////////////////////////////////////// +// END-GENERATED-HEADERS +//////////////////////////////////////////////////////////////////////////////// diff --git a/libcxx/test/libcxx/no_assert_include.compile.pass.cpp b/libcxx/test/libcxx/no_assert_include.compile.pass.cpp --- a/libcxx/test/libcxx/no_assert_include.compile.pass.cpp +++ b/libcxx/test/libcxx/no_assert_include.compile.pass.cpp @@ -1,228 +1,228 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// Ensure that none of the standard C++ headers implicitly include cassert or -// assert.h (because assert() is implemented as a macro). - -// GCC 5 has incomplete support for C++17, so some headers fail when included. -// UNSUPPORTED: gcc-5 && c++17 - -// Prevent from generating deprecated warnings for this test. -#if defined(__DEPRECATED) -# undef __DEPRECATED -#endif - -//////////////////////////////////////////////////////////////////////////////// -// BEGIN-GENERATED-HEADERS -//////////////////////////////////////////////////////////////////////////////// - -// clang-format off - -// WARNING: This test was generated by generate_header_tests.py -// and should not be edited manually. - -// Top level headers -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif -#include -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif -#include -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif -#include -#include -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#include -#include -#include -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#include -#include -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif -#include -#include -#ifndef _LIBCPP_HAS_NO_THREADS -# include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// experimental headers -#if __cplusplus >= 201103L -# include -# if defined(__cpp_coroutines) -# include -# endif -# include -# include -# include -# include -# include -# include -# include -# include -# include -# ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -# endif -# include -# include -# include -# include -# include -# include -# include -# include -#endif // __cplusplus >= 201103L - -// extended headers -#include -#include - -// clang-format on - -//////////////////////////////////////////////////////////////////////////////// -// END-GENERATED-HEADERS -//////////////////////////////////////////////////////////////////////////////// - -#ifdef assert -#error "Do not include cassert or assert.h in standard header files" -#endif +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// Ensure that none of the standard C++ headers implicitly include cassert or +// assert.h (because assert() is implemented as a macro). + +// GCC 5 has incomplete support for C++17, so some headers fail when included. +// UNSUPPORTED: gcc-5 && c++17 + +// Prevent from generating deprecated warnings for this test. +#if defined(__DEPRECATED) +# undef __DEPRECATED +#endif + +//////////////////////////////////////////////////////////////////////////////// +// BEGIN-GENERATED-HEADERS +//////////////////////////////////////////////////////////////////////////////// + +// clang-format off + +// WARNING: This test was generated by generate_header_tests.py +// and should not be edited manually. + +// Top level headers +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_THREADS +# include +#endif +#ifndef _LIBCPP_HAS_NO_THREADS +# include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#ifndef _LIBCPP_HAS_NO_THREADS +# include +#endif +#include +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#ifndef _LIBCPP_HAS_NO_THREADS +# include +#endif +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_THREADS +# include +#endif +#include +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#ifndef _LIBCPP_HAS_NO_THREADS +# include +#endif +#include +#include +#ifndef _LIBCPP_HAS_NO_THREADS +# include +#endif +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#include +#include +#include +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#include +#include +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +#endif +#include +#include +#ifndef _LIBCPP_HAS_NO_THREADS +# include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// experimental headers +#if __cplusplus >= 201103L +# include +# if defined(__cpp_coroutines) +# include +# endif +# include +# include +# include +# include +# include +# include +# include +# include +# include +# ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +# endif +# include +# include +# include +# include +# include +# include +# include +# include +#endif // __cplusplus >= 201103L + +// extended headers +#include +#include + +// clang-format on + +//////////////////////////////////////////////////////////////////////////////// +// END-GENERATED-HEADERS +//////////////////////////////////////////////////////////////////////////////// + +#ifdef assert +#error "Do not include cassert or assert.h in standard header files" +#endif diff --git a/libcxx/utils/generate_abi_list.py b/libcxx/utils/generate_abi_list.py --- a/libcxx/utils/generate_abi_list.py +++ b/libcxx/utils/generate_abi_list.py @@ -18,7 +18,7 @@ if isinstance(file, io.IOBase): return file assert isinstance(file, str), "Got object {} which is not a str".format(file) - return open(file, 'w') + return open(file, 'w', newline='\n') def main(argv): parser = argparse.ArgumentParser( diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py --- a/libcxx/utils/generate_feature_test_macro_components.py +++ b/libcxx/utils/generate_feature_test_macro_components.py @@ -670,7 +670,7 @@ cxx2a_macros=produce_macros_definition_for_std('c++2a').strip()) version_header_path = os.path.join(include_path, 'version') - with open(version_header_path, 'w') as f: + with open(version_header_path, 'w', newline='\n') as f: f.write(version_str) @@ -816,7 +816,7 @@ cxx2a_tests=generate_std_test(test_list, 'c++2a').strip()) test_name = "{header}.version.pass.cpp".format(header=h) out_path = os.path.join(macro_test_path, test_name) - with open(out_path, 'w') as f: + with open(out_path, 'w', newline='\n') as f: f.write(test_body) """ @@ -903,7 +903,7 @@ """.format(status_tables=create_table(get_status_table(), 4)) table_doc_path = os.path.join(docs_path, 'FeatureTestMacroTable.rst') - with open(table_doc_path, 'w') as f: + with open(table_doc_path, 'w', newline='\n') as f: f.write(doc_str) def main(): diff --git a/libcxx/utils/generate_header_tests.py b/libcxx/utils/generate_header_tests.py old mode 100644 new mode 100755 --- a/libcxx/utils/generate_header_tests.py +++ b/libcxx/utils/generate_header_tests.py @@ -137,13 +137,14 @@ def produce_headers(path_parts, indent_level, post_include=None, exclusions=None): pattern = os.path.join(*path_parts, '[a-z]*') - include_headers = glob.glob(pattern, recursive=False) + files = sorted(glob.glob(pattern, recursive=False)) include_headers = [ produce_include(os.path.relpath(p, include_path), indent_level, post_include=post_include) - for p in include_headers - if should_keep_header(p, exclusions)] + for p in files + if should_keep_header(p, exclusions) + ] return '\n'.join(include_headers) @@ -169,7 +170,7 @@ content = generated_part_pattern.sub( preambule + test_str + postambule, content) - with open(test_path, 'w') as f: + with open(test_path, 'w', newline='\n') as f: f.write(content)