diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 245fe1f5f2..6bb5b6c3a0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,6 +9,7 @@ set(CLANG_TEST_DIRECTORIES "Driver" "FixIt" "Frontend" + "Headers" "Index" "Lexer" "Misc" diff --git a/test/Headers/typedef_guards.c b/test/Headers/typedef_guards.c new file mode 100644 index 0000000000..1aa667bb7e --- /dev/null +++ b/test/Headers/typedef_guards.c @@ -0,0 +1,28 @@ +// RUN: %clang -fsyntax-only -verify %s + +// NULL is rdefined in stddef.h +#define NULL ((void*) 0) + +// These are headers bundled with Clang. +#include +#include + +#ifndef _VA_LIST +typedef __builtin_va_list va_list; +#endif + +#ifndef _SIZE_T +typedef __typeof__(sizeof(int)) size_t; +#endif + +#ifndef _WCHAR_T +typedef __typeof__(*L"") wchar_t; +#endif + +extern void foo(wchar_t x); +extern void bar(size_t x); +void *baz() { return NULL; } +void quz() { + va_list y; +} +