summaryrefslogtreecommitdiff
path: root/test/Preprocessor/macro_paste_commaext.c
blob: f3e6f9d409427377cd428a44bf8cc25804080e4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// RUN: %clang_cc1 %s -E | FileCheck --strict-whitespace --match-full-lines %s

// In the following tests, note that the output is sensitive to the
// whitespace *preceding* the varargs argument, as well as to
// interior whitespace. AFAIK, this is the only case where whitespace
// preceding an argument matters, and might be considered a bug in
// GCC. Nevertheless, since this feature is a GCC extension in the
// first place, we'll follow along.

#define debug(format, ...) format, ## __VA_ARGS__)
// CHECK:V);
debug(V);
// CHECK:W,1, 2);
debug(W,1, 2);
// CHECK:X, 1, 2);
debug(X, 1, 2 );
// CHECK:Y,);
debug(Y, );
// CHECK:Z,);
debug(Z,);