From 00a81b8b9daf54a09bf535734944d740bfa4ed4b Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 29 Mar 2010 16:07:29 -0400 Subject: 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 --- gcc/testsuite/c-c++-common/raw-string-10.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 gcc/testsuite/c-c++-common/raw-string-10.c (limited to 'gcc/testsuite/c-c++-common/raw-string-10.c') 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, "}"); +} -- cgit v1.1