2009-12-07 09:49:36 +08:00
|
|
|
// RUN: clang-cc -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
|
|
|
|
// CHECK: {{#define A[(]x[)] $}}
|
2009-02-06 14:45:26 +08:00
|
|
|
#define A(x)
|
|
|
|
|
|
|
|
// Space before expansion list.
|
2009-12-07 09:49:36 +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:49:36 +08:00
|
|
|
// CHECK: #define X() ..
|
2009-02-06 14:45:26 +08:00
|
|
|
#define X() ..
|
|
|
|
|
|
|
|
// Simple test.
|
2009-12-07 09:49:36 +08:00
|
|
|
// CHECK: #define Y .
|
|
|
|
// CHECK: #define Z X()Y
|
2009-02-06 14:45:26 +08:00
|
|
|
#define Y .
|
|
|
|
#define Z X()Y
|
|
|
|
|
|
|
|
// gcc prints macros at end of translation unit, so last one wins.
|
2009-12-07 09:49:36 +08:00
|
|
|
// CHECK: #define foo 2
|
2009-02-06 14:45:26 +08:00
|
|
|
#define foo 1
|
|
|
|
#undef foo
|
|
|
|
#define foo 2
|
|
|
|
|