2009-04-13 09:29:17 +08:00
|
|
|
// __COUNTER__ support: rdar://4329310
|
2013-01-25 07:44:04 +08:00
|
|
|
// RUN: %clang -E %s | FileCheck %s
|
2009-04-13 09:29:17 +08:00
|
|
|
|
|
|
|
#define PASTE2(x,y) x##y
|
|
|
|
#define PASTE1(x,y) PASTE2(x,y)
|
|
|
|
#define UNIQUE(x) PASTE1(x,__COUNTER__)
|
|
|
|
|
|
|
|
A: __COUNTER__
|
|
|
|
B: UNIQUE(foo);
|
|
|
|
C: UNIQUE(foo);
|
|
|
|
D: __COUNTER__
|
2013-01-25 07:44:04 +08:00
|
|
|
|
|
|
|
// CHECK: A: 0
|
|
|
|
// CHECK: B: foo1;
|
|
|
|
// CHECK: C: foo2;
|
|
|
|
// CHECK: D: 3
|
|
|
|
|