diff options
author | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
commit | ec2b103c267a06a66e926f62cd96767b280f5cf5 (patch) | |
tree | ce7d964cbb5e39695b71481698f10cb099c23d4a /test/Preprocessor/macro_fn_comma_swallow.c |
Notes
Diffstat (limited to 'test/Preprocessor/macro_fn_comma_swallow.c')
-rw-r--r-- | test/Preprocessor/macro_fn_comma_swallow.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Preprocessor/macro_fn_comma_swallow.c b/test/Preprocessor/macro_fn_comma_swallow.c new file mode 100644 index 0000000000000..e985138a5c44c --- /dev/null +++ b/test/Preprocessor/macro_fn_comma_swallow.c @@ -0,0 +1,21 @@ +// Test the GNU comma swallowing extension. +// RUN: clang-cc %s -E | grep 'foo{A, }' && +// RUN: clang-cc %s -E | grep 'fo2{A,}' && +// RUN: clang-cc %s -E | grep '{foo}' + +#define X(Y) foo{A, Y} +X() + +#define X2(Y) fo2{A,##Y} +X2() + +// should eat the comma. +#define X3(b, ...) {b, ## __VA_ARGS__} +X3(foo) + + + +// RUN: clang-cc %s -E | grep 'AA BB' +// PR3880 +#define X4(...) AA , ## __VA_ARGS__ BB +X4() |