blob: bdc69536778de90a5146ec2dd4cdee127985c7e7 [file] [log] [blame]
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00001// RUN: clang-cc -E -dM %s -o %t
Chris Lattnerf73903a2009-02-06 06:45:26 +00002
3// Space even without expansion tokens
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00004// RUN: grep "#define A(x) " %t
Chris Lattnerf73903a2009-02-06 06:45:26 +00005#define A(x)
6
7// Space before expansion list.
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00008// RUN: grep "#define B(x,y) x y" %t
Chris Lattnerf73903a2009-02-06 06:45:26 +00009#define B(x,y)x y
10
11// No space in expansion list.
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000012// RUN: grep "#define C(x,y) x y" %t
Chris Lattnerf73903a2009-02-06 06:45:26 +000013#define C(x, y) x y
14
15// No paste avoidance.
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000016// RUN: grep "#define X() .." %t
Chris Lattnerf73903a2009-02-06 06:45:26 +000017#define X() ..
18
19// Simple test.
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000020// RUN: grep "#define Y ." %t
21// RUN: grep "#define Z X()Y" %t
Chris Lattnerf73903a2009-02-06 06:45:26 +000022#define Y .
23#define Z X()Y
24
25// gcc prints macros at end of translation unit, so last one wins.
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000026// RUN: grep "#define foo 2" %t
Chris Lattnerf73903a2009-02-06 06:45:26 +000027// RUN: not grep "#define foo 1" %t
28#define foo 1
29#undef foo
30#define foo 2
31