summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor/macro_raw_string.cpp
diff options
context:
space:
mode:
authorTaewook Oh <twoh@fb.com>2017-12-06 17:00:53 +0000
committerTaewook Oh <twoh@fb.com>2017-12-06 17:00:53 +0000
commitcebac48bf7e52e352b8cda806a64dab66df4c64f (patch)
tree2b956b1205290e222a260cc9d1c91fd82f119a69 /clang/test/Preprocessor/macro_raw_string.cpp
parentddf4ef395973d79098df10b2dfe282476b84e60f (diff)
downloadbcm5719-llvm-cebac48bf7e52e352b8cda806a64dab66df4c64f.tar.gz
bcm5719-llvm-cebac48bf7e52e352b8cda806a64dab66df4c64f.zip
Stringizing raw string literals containing newline
Summary: This patch implements 4.3 of http://open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4220.pdf. If a raw string contains a newline character, replace each newline character with the \n escape code. Without this patch, included test case (macro_raw_string.cpp) results compilation failure. Reviewers: rsmith, doug.gregor, jkorous-apple Reviewed By: jkorous-apple Subscribers: jkorous-apple, vsapsai, cfe-commits Differential Revision: https://reviews.llvm.org/D39279 llvm-svn: 319904
Diffstat (limited to 'clang/test/Preprocessor/macro_raw_string.cpp')
-rw-r--r--clang/test/Preprocessor/macro_raw_string.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Preprocessor/macro_raw_string.cpp b/clang/test/Preprocessor/macro_raw_string.cpp
new file mode 100644
index 00000000000..d56894888d1
--- /dev/null
+++ b/clang/test/Preprocessor/macro_raw_string.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -E -std=c++11 %s -o %t
+// RUN: %clang_cc1 %t
+
+#define FOO(str) foo(#str)
+
+extern void foo(const char *str);
+
+void bar() {
+ FOO(R"(foo
+ bar)");
+}
OpenPOWER on IntegriCloud