aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/raw-string-10.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-03-29 16:07:29 -0400
committerJason Merrill <jason@gcc.gnu.org>2010-03-29 16:07:29 -0400
commit00a81b8b9daf54a09bf535734944d740bfa4ed4b (patch)
tree84b8a4bdf2073b4abe400607bab3f439398a212c /gcc/testsuite/c-c++-common/raw-string-10.c
parent0591d33ecce39bc9d1b5871f98863de70f28c898 (diff)
downloadgcc-00a81b8b9daf54a09bf535734944d740bfa4ed4b.zip
gcc-00a81b8b9daf54a09bf535734944d740bfa4ed4b.tar.gz
gcc-00a81b8b9daf54a09bf535734944d740bfa4ed4b.tar.bz2
More N3077 raw string changes
More N3077 raw string changes * charset.c (cpp_interpret_string): Don't transform UCNs in raw strings. * lex.c (bufring_append): Split out from... (lex_raw_string): ...here. Undo trigraph and line splicing transformations. Do process line notes in multi-line literals. (_cpp_process_line_notes): Ignore notes that were already handled. From-SVN: r157804
Diffstat (limited to 'gcc/testsuite/c-c++-common/raw-string-10.c')
-rw-r--r--gcc/testsuite/c-c++-common/raw-string-10.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/raw-string-10.c b/gcc/testsuite/c-c++-common/raw-string-10.c
new file mode 100644
index 0000000..76ed34e
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/raw-string-10.c
@@ -0,0 +1,20 @@
+// Test that we don't revert trigraphs and line splicing when a raw string
+// literal is formed by token pasting.
+// { dg-options "-std=gnu99 -trigraphs" { target c } }
+// { dg-options "-std=c++0x" { target c++ } }
+// { dg-do run }
+
+#define PASTE(X,Y) X##Y
+
+const char a[] = PASTE(R,"(??>\
+)");
+
+#define TEST(str, val) \
+ if (sizeof (str) != sizeof (val) \
+ || __builtin_memcmp (str, val, sizeof (str)) != 0) \
+ __builtin_abort ()
+
+int main()
+{
+ TEST (a, "}");
+}