//===----------------------------------------------------------------------===// // // 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} // Prevent from generating deprecated warnings for this test. #if defined(__DEPRECATED) # undef __DEPRECATED #endif /* BEGIN-SCRIPT for header in public_headers: print("{}#{}include <{}>{}".format( '#if ' + header_restrictions[header] + '\n' if header in header_restrictions else '', 3 * ' ' if header in header_restrictions else '', header, '\n#endif' if header in header_restrictions else '' )) END-SCRIPT */ // DO NOT MANUALLY EDIT ANYTHING BETWEEN THE MARKERS BELOW // GENERATED-MARKER #include #include #include #include #if !defined(_LIBCPP_HAS_NO_THREADS) # include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include #endif #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include #endif #include #include #include #include #include #if (defined(__cpp_impl_coroutine) && __cpp_impl_coroutine >= 201902L) || (defined(__cpp_coroutines) && __cpp_coroutines >= 201703L) # include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #if !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) # include #endif #if !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) # include #endif #include #include #include #include #include #include #if !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY) # include #endif #include #include #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) && !defined(_LIBCPP_HAS_NO_FSTREAM) # include #endif #include #if !defined(_LIBCPP_HAS_NO_THREADS) # include #endif #include #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include #endif #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include #endif #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include #endif #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include #endif #include #if !defined(_LIBCPP_HAS_NO_THREADS) # include #endif #include #include #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include #endif #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include #endif #include #include #include #include #if !defined(_LIBCPP_HAS_NO_THREADS) # include #endif #include #include #include #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include #endif #include #include #include #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include #endif #include #if !defined(_LIBCPP_HAS_NO_THREADS) # include #endif #include #include #if !defined(_LIBCPP_HAS_NO_THREADS) # include #endif #include #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include #endif #include #if __cplusplus > 202002L && !defined(_LIBCPP_HAS_NO_THREADS) # include #endif #include #include #include #include #include #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include #endif #include #include #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include #endif #include #include #if !defined(_LIBCPP_HAS_NO_THREADS) # include #endif #include #include #include #include #include #include #include #include #include #include #include #include #if !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) # include #endif #if !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) # include #endif #if __cplusplus >= 201103L # include #endif #if __cplusplus >= 201103L # include #endif #if __cplusplus >= 201103L # include #endif #if __cplusplus >= 201103L # include #endif #if __cplusplus >= 201103L # include #endif #if __cplusplus >= 201103L # include #endif #if __cplusplus >= 201103L # include #endif #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) && __cplusplus >= 201103L # include #endif #if __cplusplus >= 201103L # include #endif #if __cplusplus >= 201103L # include #endif #if __cplusplus >= 201103L # include #endif #if __cplusplus >= 201103L # include #endif #if __cplusplus >= 201103L # include #endif #if __cplusplus >= 201103L # include #endif #if __cplusplus >= 201103L # include #endif #if __cplusplus >= 201103L # include #endif #include #include // GENERATED-MARKER #if defined(WITH_MAIN) int main(int, char**) { return 0; } #endif