From 554bcb69c2d785a011a30e7db87a36a87fe7db10 Mon Sep 17 00:00:00 2001 From: dim Date: Wed, 15 Aug 2012 20:02:54 +0000 Subject: Vendor import of clang trunk r161861: http://llvm.org/svn/llvm-project/cfe/trunk@161861 --- test/Preprocessor/has_include.c | 48 +++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 11 deletions(-) (limited to 'test/Preprocessor/has_include.c') diff --git a/test/Preprocessor/has_include.c b/test/Preprocessor/has_include.c index fdcae78..13c8d56 100644 --- a/test/Preprocessor/has_include.c +++ b/test/Preprocessor/has_include.c @@ -65,19 +65,45 @@ #endif // Try badly formed expressions. -// FIXME: I don't quite know how to avoid preprocessor side effects. -// Use FileCheck? -// It also assert due to unterminated #if's. +// FIXME: We can recover better in almost all of these cases. (PR13335) + +// expected-error@+1 {{missing '(' after '__has_include'}} expected-error@+1 {{expected end of line}} +#if __has_include "stdint.h") +#endif + +// expected-error@+1 {{expected "FILENAME" or }} expected-error@+1 {{token is not a valid binary operator in a preprocessor subexpression}} +#if __has_include(stdint.h) +#endif + +// expected-error@+1 {{expected "FILENAME" or }} +#if __has_include() +#endif + +// expected-error@+1 {{missing '(' after '__has_include'}} +#if __has_include) +#endif + +// expected-error@+1 {{missing '(' after '__has_include'}} expected-error@+1 {{token is not a valid binary operator in a preprocessor subexpression}} +#if __has_include) +#endif + +// expected-error@+1 {{expected "FILENAME" or }} expected-warning@+1 {{missing terminating '"' character}} +#if __has_include("stdint.h) +#endif + +// expected-error@+1 {{expected "FILENAME" or }} expected-warning@+1 {{missing terminating '"' character}} expected-error@+1 {{token is not a valid binary operator in a preprocessor subexpression}} +#if __has_include(stdint.h") +#endif + +// expected-error@+1 {{expected "FILENAME" or }} expected-error@+1 {{token is not a valid binary operator in a preprocessor subexpression}} +#if __has_include(stdint.h>) +#endif + + +// FIXME: These test cases cause the compiler to crash. (PR13334) //#if __has_include("stdint.h" -//#if __has_include "stdint.h") -//#if __has_include(stdint.h) -//#if __has_include() //#if __has_include( -//#if __has_include) //#if __has_include //#if __has_include( -//#if __has_include) -//#if __has_include("stdint.h) -//#if __has_include(stdint.h") //#if __has_include() + -- cgit v1.1