2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -E -dM %s -o - | FileCheck %s -strict-whitespace
|
2009-02-06 14:45:26 +08:00
|
|
|
|
2009-12-07 09:49:36 +08:00
|
|
|
// Space at end even without expansion tokens
|
2009-12-09 08:04:46 +08:00
|
|
|
// CHECK: #define A(x)
|
2009-02-06 14:45:26 +08:00
|
|
|
#define A(x)
|
|
|
|
|
|
|
|
// Space before expansion list.
|
2009-12-09 08:04:46 +08:00
|
|
|
// CHECK: #define B(x,y) x y
|
2009-02-06 14:45:26 +08:00
|
|
|
#define B(x,y)x y
|
|
|
|
|
2009-12-07 09:49:36 +08:00
|
|
|
// No space in argument list.
|
|
|
|
// CHECK: #define C(x,y) x y
|
2009-02-06 14:45:26 +08:00
|
|
|
#define C(x, y) x y
|
|
|
|
|
|
|
|
// No paste avoidance.
|
2009-12-07 09:57:13 +08:00
|
|
|
// CHECK: #define D() ..
|
|
|
|
#define D() ..
|
2009-02-06 14:45:26 +08:00
|
|
|
|
|
|
|
// Simple test.
|
2009-12-07 09:57:13 +08:00
|
|
|
// CHECK: #define E .
|
|
|
|
// CHECK: #define F X()Y
|
|
|
|
#define E .
|
|
|
|
#define F X()Y
|
2009-02-06 14:45:26 +08:00
|
|
|
|
|
|
|
// gcc prints macros at end of translation unit, so last one wins.
|
2009-12-07 09:57:13 +08:00
|
|
|
// CHECK: #define G 2
|
|
|
|
#define G 1
|
|
|
|
#undef G
|
|
|
|
#define G 2
|
2009-12-07 09:58:34 +08:00
|
|
|
|
|
|
|
// Variadic macros of various sorts. PR5699
|
|
|
|
|
|
|
|
// CHECK: H(x,...) __VA_ARGS__
|
|
|
|
#define H(x, ...) __VA_ARGS__
|
|
|
|
// CHECK: I(...) __VA_ARGS__
|
|
|
|
#define I(...) __VA_ARGS__
|
|
|
|
// CHECK: J(x...) __VA_ARGS__
|
|
|
|
#define J(x ...) __VA_ARGS__
|