summaryrefslogtreecommitdiffstats
path: root/tests/preprocessor/escaped-newlines.slang
blob: 1c1fa8f1072baff0488264fd67b1816dfc369f87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//TEST:SIMPLE:

// Test support for escaped newlines in macro definitions.
//
// A complete lexer would handle backslash-escaped newlines
// in every possible context (including, e.g., in the middle
// of an identifier), but we are not going to go to such
// lengths right now.

#define FOO(x, y) 	\
	x				\
	y				\
	/* */

FOO(float, bar)(float a)
{
	FOO(return, a);
}

float foo(float x)
{
	return bar(x);
}