llvm-capstone/clang/test/Preprocessor/macro_arg_empty.c
Justin Bogner eacd96d972 Fix whitespace handling in empty macro arguments
When a function-like macro definition ends with one of the macro's
parameters, and the argument is empty, any whitespace before the
parameter name in the macro definition needs to be preserved. Promoting
the existing NextTokGetsSpace to a preserved bit-field and checking it
at the end of the macro expansion allows it to be moved to the first
token following the macro expansion result.

Patch by Harald van Dijk!

llvm-svn: 200786
2014-02-04 19:18:32 +00:00

8 lines
228 B
C

// RUN: %clang_cc1 -E %s | FileCheck --strict-whitespace %s
#define FOO(x) x
#define BAR(x) x x
#define BAZ(x) [x] [ x] [x ]
[FOO()] [ FOO()] [FOO() ] [BAR()] [ BAR()] [BAR() ] BAZ()
// CHECK: [] [ ] [ ] [ ] [ ] [ ] [] [ ] [ ]