From 6f8cfccbd36de601b6f35a854cb0dba5b9757495 Mon Sep 17 00:00:00 2001 From: Andy Gibbs Date: Fri, 1 Apr 2016 19:02:20 +0000 Subject: Diagnose missing macro argument following charize operator. For completeness, add a test-case for the equivalent stringize operator diagnostic too. llvm-svn: 265177 --- clang/test/Preprocessor/stringize_misc.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'clang/test/Preprocessor/stringize_misc.c') diff --git a/clang/test/Preprocessor/stringize_misc.c b/clang/test/Preprocessor/stringize_misc.c index 6c2c78d17ac..fc7253e5049 100644 --- a/clang/test/Preprocessor/stringize_misc.c +++ b/clang/test/Preprocessor/stringize_misc.c @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -E %s | FileCheck -strict-whitespace %s +#ifdef TEST1 +// RUN: %clang_cc1 -E %s -DTEST1 | FileCheck -strict-whitespace %s #define M(x, y) #x #y @@ -28,3 +29,13 @@ START_END( {a=1 , b=2;} ) /* braces are not parentheses */ M(a COMMA b, (a, b)) // CHECK: "a COMMA b" "(a, b)" +#endif + +#ifdef TEST2 +// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST2 + +#define HASH # +#define INVALID() # +// expected-error@-1{{'#' is not followed by a macro parameter}} + +#endif -- cgit v1.2.3