diff options
| author | Eric Fiselier <eric@efcs.ca> | 2017-06-16 01:57:41 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2017-06-16 01:57:41 +0000 |
| commit | 56312f5ad539872ff20ccf72c7d35028ad539835 (patch) | |
| tree | 2afde2f2edfb511d0c0d3142cbcd40fbf8335a48 /libcxx/test | |
| parent | 4d76da4fc931746ade1d016d956644d7d70fd97c (diff) | |
| download | bcm5719-llvm-56312f5ad539872ff20ccf72c7d35028ad539835.tar.gz bcm5719-llvm-56312f5ad539872ff20ccf72c7d35028ad539835.zip | |
Allow the libc++ C header wrappers to be included when compiling C.
C99 at least. C89 still fails due to the use of block comments.
NOTE: Having libc++ on the include path when compiling C is not
recommended or ever really supported. However it happens often
enough that this change is warrented.
llvm-svn: 305539
Diffstat (limited to 'libcxx/test')
| -rw-r--r-- | libcxx/test/libcxx/include_as_c.sh.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libcxx/test/libcxx/include_as_c.sh.cpp b/libcxx/test/libcxx/include_as_c.sh.cpp new file mode 100644 index 00000000000..db50d835ec1 --- /dev/null +++ b/libcxx/test/libcxx/include_as_c.sh.cpp @@ -0,0 +1,37 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// Test that the C wrapper headers can be included when compiling them as C. + +// NOTE: It's not common or recommended to have libc++ in the header search +// path when compiling C files, but it does happen often enough. + +// RUN: %cxx -c -xc %s -fsyntax-only %flags %compile_flags -std=c99 + +#include <complex.h> +#include <ctype.h> +#include <errno.h> +#include <float.h> +#include <inttypes.h> +#include <limits.h> +#include <locale.h> +#include <math.h> +#include <setjmp.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <tgmath.h> +#include <wchar.h> +#include <wctype.h> + +int main() {} |

