summaryrefslogtreecommitdiffstats
path: root/tests/preprocessor/paste-non-expansion.slang
blob: d3487aeef8599b911152f80e30ac1d45fd2da668 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//DIAGNOSTIC_TEST:SIMPLE:-E

// This os a regression test for a bug in Slang preprocessor macro expansion.

#define CONCAT2(x, y) x ## y
#define CONCAT(x, y) CONCAT2(x, y)

#define SOMETHING someThing

// Should be someThingElse
CONCAT(SOMETHING, Else)
// Should be SOMETHINGAnother, but old Slang expands to produce someThingAnother
CONCAT2(SOMETHING, Another)