aboutsummaryrefslogtreecommitdiff
path: root/test/Lexer/counter.c
blob: 70ac98e727d5c6467bf7aee7e781051e0fa5f32a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// __COUNTER__ support: rdar://4329310
// RUN: %clang -E %s | FileCheck %s

#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__

// CHECK: A: 0
// CHECK: B: foo1;
// CHECK: C: foo2;
// CHECK: D: 3