blob: 29b1d293943e67329ed455ae8afbd630e92873a1 [file] [log] [blame]
Chris Lattner9944f782009-12-07 01:49:36 +00001// RUN: clang-cc -E -dM %s -o - | FileCheck %s -strict-whitespace
Chris Lattnerf73903a2009-02-06 06:45:26 +00002
Chris Lattner9944f782009-12-07 01:49:36 +00003// Space at end even without expansion tokens
4// CHECK: {{#define A[(]x[)] $}}
Chris Lattnerf73903a2009-02-06 06:45:26 +00005#define A(x)
6
7// Space before expansion list.
Chris Lattner9944f782009-12-07 01:49:36 +00008// CHECK: {{#define B[(]x,y[)] x y$}}
Chris Lattnerf73903a2009-02-06 06:45:26 +00009#define B(x,y)x y
10
Chris Lattner9944f782009-12-07 01:49:36 +000011// No space in argument list.
12// CHECK: #define C(x,y) x y
Chris Lattnerf73903a2009-02-06 06:45:26 +000013#define C(x, y) x y
14
15// No paste avoidance.
Chris Lattner5146b1b2009-12-07 01:57:13 +000016// CHECK: #define D() ..
17#define D() ..
Chris Lattnerf73903a2009-02-06 06:45:26 +000018
19// Simple test.
Chris Lattner5146b1b2009-12-07 01:57:13 +000020// CHECK: #define E .
21// CHECK: #define F X()Y
22#define E .
23#define F X()Y
Chris Lattnerf73903a2009-02-06 06:45:26 +000024
25// gcc prints macros at end of translation unit, so last one wins.
Chris Lattner5146b1b2009-12-07 01:57:13 +000026// CHECK: #define G 2
27#define G 1
28#undef G
29#define G 2