From 97fc943b476e2482bd1f99c9e76f0dfe8fdd36e0 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 12 Jun 2017 12:37:07 -0700 Subject: Add test case for escaped newlines. This also serves as a regression test for the recent preprocessor bug fix. --- tests/preprocessor/escaped-newlines.slang | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/preprocessor/escaped-newlines.slang (limited to 'tests/preprocessor') diff --git a/tests/preprocessor/escaped-newlines.slang b/tests/preprocessor/escaped-newlines.slang new file mode 100644 index 000000000..1c1fa8f10 --- /dev/null +++ b/tests/preprocessor/escaped-newlines.slang @@ -0,0 +1,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); +} -- cgit v1.2.3