1 // -*- C++ -*- 2 //===----------------------------------------------------------------------===// 3 // 4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 // See https://llvm.org/LICENSE.txt for license information. 6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 // 8 //===----------------------------------------------------------------------===// 9 10 // We're building as C, so this test doesn't work when building with modules. 11 // UNSUPPORTED: -fmodules 12 13 // GCC complains about unrecognized arguments because we're compiling the 14 // file as C, but we're passing C++ flags on the command-line. 15 // UNSUPPORTED: gcc 16 17 // Test that the C wrapper headers can be included when compiling them as C. 18 19 // NOTE: It's not common or recommended to have libc++ in the header search 20 // path when compiling C files, but it does happen often enough. 21 22 // RUN: %{cxx} -c -xc %s -fsyntax-only %{flags} %{compile_flags} -std=c99 23 24 #include <__config> 25 26 #include <complex.h> 27 #include <ctype.h> 28 #include <errno.h> 29 #include <fenv.h> 30 #include <float.h> 31 #include <inttypes.h> 32 #include <limits.h> 33 #ifndef _LIBCPP_HAS_NO_LOCALIZATION 34 # include <locale.h> 35 #endif 36 #include <math.h> 37 #include <setjmp.h> 38 #include <stdbool.h> 39 #include <stddef.h> 40 #include <stdint.h> 41 #include <stdio.h> 42 #include <stdlib.h> 43 #include <string.h> 44 // The clang-shipped tgmath.h header doesn't work with MSVC/UCRT's complex 45 // headers in C mode, see PR46207. 46 #ifndef _MSC_VER 47 # include <tgmath.h> 48 #endif 49 #include <wchar.h> 50 #include <wctype.h> 51 52 int main(int argc, char **argv) { 53 (void)argc; 54 (void)argv; 55 return 0; 56 } 57