extern_c.pass.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. // Sometimes C++'s <foo.h> headers get included within extern "C" contexts. This
  9. // is ill-formed (no diagnostic required), per [using.headers]p3, but we permit
  10. // it as an extension.
  11. extern "C" {
  12. #include <assert.h>
  13. // complex.h is not supported in extern "C".
  14. #include <ctype.h>
  15. #include <errno.h>
  16. #include <fenv.h>
  17. #include <float.h>
  18. #include <inttypes.h>
  19. #include <iso646.h>
  20. #include <limits.h>
  21. #include <locale.h>
  22. #include <math.h>
  23. #include <setjmp.h>
  24. #include <signal.h>
  25. #include <stdalign.h>
  26. #include <stdarg.h>
  27. #include <stdbool.h>
  28. #include <stddef.h>
  29. #include <stdint.h>
  30. #include <stdio.h>
  31. #include <stdlib.h>
  32. #include <string.h>
  33. // tgmath.h is not supported in extern "C".
  34. #include <time.h>
  35. // FIXME: #include <uchar.h>
  36. #include <wchar.h>
  37. #include <wctype.h>
  38. }
  39. int main(int, char**) {
  40. return 0;
  41. }