From f7507f29d70c4ffba343fd339bfd0801032d0886 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 8 Mar 2010 23:38:27 +0000 Subject: [PATCH] Add test cases for r98003 and r98006. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98008 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CMakeLists.txt | 1 + test/Headers/typedef_guards.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 test/Headers/typedef_guards.c 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; +} +