summaryrefslogtreecommitdiffstats
path: root/tests/preprocessor
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-06-12 15:34:12 -0700
committerGitHub <noreply@github.com>2017-06-12 15:34:12 -0700
commit7fc4c40b17f340800d6616e0bae111606cef18cc (patch)
treee1c59d0b48397e8e33428e65a2e0f3c6925c65d9 /tests/preprocessor
parentce90fec1c795eaafbd91d7b8a83501a57eeb1946 (diff)
parent97fc943b476e2482bd1f99c9e76f0dfe8fdd36e0 (diff)
Merge pull request #4 from tfoleyNV/escaped-newlines
Escaped newlines
Diffstat (limited to 'tests/preprocessor')
-rw-r--r--tests/preprocessor/escaped-newlines.slang23
1 files changed, 23 insertions, 0 deletions
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);
+}