Home | History | Annotate | Download | only in libcxx
      1 // -*- C++ -*-
      2 //===----------------------------------------------------------------------===//
      3 //
      4 //                     The LLVM Compiler Infrastructure
      5 //
      6 // This file is dual licensed under the MIT and the University of Illinois Open
      7 // Source Licenses. See LICENSE.TXT for details.
      8 //
      9 //===----------------------------------------------------------------------===//
     10 
     11 // Test that we can include each header in two TU's and link them together.
     12 
     13 // RUN: %cxx -c %s -o %t.first.o %flags %compile_flags
     14 // RUN: %cxx -c %s -o %t.second.o -DWITH_MAIN %flags %compile_flags
     15 // RUN: %cxx -o %t.exe %t.first.o %t.second.o %flags %link_flags
     16 // RUN: %run
     17 
     18 // Prevent <ext/hash_map> from generating deprecated warnings for this test.
     19 #if defined(__DEPRECATED)
     20 #undef __DEPRECATED
     21 #endif
     22 
     23 // Top level headers
     24 #include <algorithm>
     25 #include <any>
     26 #include <array>
     27 #ifndef _LIBCPP_HAS_NO_THREADS
     28 #include <atomic>
     29 #endif
     30 #include <bitset>
     31 #include <cassert>
     32 #include <ccomplex>
     33 #include <cctype>
     34 #include <cerrno>
     35 #include <cfenv>
     36 #include <cfloat>
     37 #include <chrono>
     38 #include <cinttypes>
     39 #include <ciso646>
     40 #include <climits>
     41 #include <clocale>
     42 #include <cmath>
     43 #include <codecvt>
     44 #include <complex>
     45 #include <complex.h>
     46 #include <condition_variable>
     47 #include <csetjmp>
     48 #include <csignal>
     49 #include <cstdarg>
     50 #include <cstdbool>
     51 #include <cstddef>
     52 #include <cstdint>
     53 #include <cstdio>
     54 #include <cstdlib>
     55 #include <cstring>
     56 #include <ctgmath>
     57 #include <ctime>
     58 #include <ctype.h>
     59 #include <cwchar>
     60 #include <cwctype>
     61 #include <deque>
     62 #include <errno.h>
     63 #include <exception>
     64 #include <float.h>
     65 #include <forward_list>
     66 #include <fstream>
     67 #include <functional>
     68 #ifndef _LIBCPP_HAS_NO_THREADS
     69 #include <future>
     70 #endif
     71 #include <initializer_list>
     72 #include <inttypes.h>
     73 #include <iomanip>
     74 #include <ios>
     75 #include <iosfwd>
     76 #include <iostream>
     77 #include <istream>
     78 #include <iterator>
     79 #include <limits>
     80 #include <limits.h>
     81 #include <list>
     82 #include <locale>
     83 #include <locale.h>
     84 #include <map>
     85 #include <math.h>
     86 #include <memory>
     87 #ifndef _LIBCPP_HAS_NO_THREADS
     88 #include <mutex>
     89 #endif
     90 #include <new>
     91 #include <numeric>
     92 #include <optional>
     93 #include <ostream>
     94 #include <queue>
     95 #include <random>
     96 #include <ratio>
     97 #include <regex>
     98 #include <scoped_allocator>
     99 #include <set>
    100 #include <setjmp.h>
    101 #ifndef _LIBCPP_HAS_NO_THREADS
    102 #include <shared_mutex>
    103 #endif
    104 #include <sstream>
    105 #include <stack>
    106 #include <stdbool.h>
    107 #include <stddef.h>
    108 #include <stdexcept>
    109 #include <stdint.h>
    110 #include <stdio.h>
    111 #include <stdlib.h>
    112 #include <streambuf>
    113 #include <string>
    114 #include <string.h>
    115 #include <string_view>
    116 #include <strstream>
    117 #include <system_error>
    118 #include <tgmath.h>
    119 #ifndef _LIBCPP_HAS_NO_THREADS
    120 #include <thread>
    121 #endif
    122 #include <tuple>
    123 #include <typeindex>
    124 #include <typeinfo>
    125 #include <type_traits>
    126 #include <unordered_map>
    127 #include <unordered_set>
    128 #include <utility>
    129 #include <valarray>
    130 #include <variant>
    131 #include <vector>
    132 #include <wchar.h>
    133 #include <wctype.h>
    134 
    135 // experimental headers
    136 #if __cplusplus >= 201103L
    137 #include <experimental/algorithm>
    138 #include <experimental/any>
    139 #include <experimental/chrono>
    140 #include <experimental/deque>
    141 #include <experimental/dynarray>
    142 #include <experimental/filesystem>
    143 #include <experimental/forward_list>
    144 #include <experimental/functional>
    145 #include <experimental/iterator>
    146 #include <experimental/list>
    147 #include <experimental/map>
    148 #include <experimental/memory_resource>
    149 #include <experimental/numeric>
    150 #include <experimental/optional>
    151 #include <experimental/propagate_const>
    152 #include <experimental/ratio>
    153 #include <experimental/regex>
    154 #include <experimental/set>
    155 #include <experimental/string>
    156 #include <experimental/string_view>
    157 #include <experimental/system_error>
    158 #include <experimental/tuple>
    159 #include <experimental/type_traits>
    160 #include <experimental/unordered_map>
    161 #include <experimental/unordered_set>
    162 #include <experimental/utility>
    163 #include <experimental/vector>
    164 #endif // __cplusplus >= 201103L
    165 
    166 // extended headers
    167 #include <ext/hash_map>
    168 #include <ext/hash_set>
    169 
    170 #if defined(WITH_MAIN)
    171 int main() {}
    172 #endif
    173