blob: 689d966e867a0673847bf45c219e256b4c574948 [file] [log] [blame]
Jordan Rosea08ed592013-02-08 22:30:31 +00001// RUN: %clang_cc1 -E -std=c++11 %s -o - | FileCheck -strict-whitespace %s
Edward O'Callaghanf78edf52009-10-27 02:36:32 +00002
3
Chris Lattner341c9a12006-07-28 06:54:07 +00004#define y(a) ..a
Chris Lattnerca515cc2009-04-21 23:28:41 +00005A: y(.)
Edward O'Callaghanf78edf52009-10-27 02:36:32 +00006// This should print as ".. ." to avoid turning into ...
Chris Lattner0384e6352010-04-14 03:57:19 +00007// CHECK: A: .. .
Chris Lattner341c9a12006-07-28 06:54:07 +00008
Chris Lattner0384e6352010-04-14 03:57:19 +00009#define X 0 .. 1
10B: X
11// CHECK: B: 0 .. 1
Edward O'Callaghanf78edf52009-10-27 02:36:32 +000012
Chris Lattnerca515cc2009-04-21 23:28:41 +000013#define DOT .
14C: ..DOT
Edward O'Callaghanf78edf52009-10-27 02:36:32 +000015// CHECK: C: .. .
Chris Lattnerca515cc2009-04-21 23:28:41 +000016
17
Chris Lattner341c9a12006-07-28 06:54:07 +000018#define PLUS +
19#define EMPTY
20#define f(x) =x=
Chris Lattnerca515cc2009-04-21 23:28:41 +000021D: +PLUS -EMPTY- PLUS+ f(=)
Edward O'Callaghanf78edf52009-10-27 02:36:32 +000022// CHECK: D: + + - - + + = = =
Chris Lattner341c9a12006-07-28 06:54:07 +000023
Chris Lattner15346fa2008-01-15 05:22:14 +000024
Chris Lattner15346fa2008-01-15 05:22:14 +000025#define test(x) L#x
Chris Lattnerca515cc2009-04-21 23:28:41 +000026E: test(str)
Edward O'Callaghanf78edf52009-10-27 02:36:32 +000027// Should expand to L "str" not L"str"
28// CHECK: E: L "str"
Chris Lattner15346fa2008-01-15 05:22:14 +000029
Chris Lattner80dbccd2010-03-26 17:10:02 +000030// Should avoid producing >>=.
31#define equal =
32F: >>equal
33// CHECK: F: >> =
Argyrios Kyrtzidis005206a82013-01-29 20:28:24 +000034
35// Make sure we don't introduce spaces in the guid because we try to avoid
36// pasting '-' to a numeric constant.
37#define TYPEDEF(guid) typedef [uuid(guid)]
38TYPEDEF(66504301-BE0F-101A-8BBB-00AA00300CAB) long OLE_COLOR;
39// CHECK: typedef [uuid(66504301-BE0F-101A-8BBB-00AA00300CAB)] long OLE_COLOR;
Jordan Rosea08ed592013-02-08 22:30:31 +000040
41// Be careful with UD-suffixes.
42#define StrSuffix() "abc"_suffix
43#define IntSuffix() 123_suffix
44UD: StrSuffix()ident
45UD: IntSuffix()ident
46// CHECK: UD: "abc"_suffix ident
47// CHECK: UD: 123_suffix ident