aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/raw-string-10.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/raw-string-10.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/raw-string-10.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/raw-string-10.c b/gcc-4.9/gcc/testsuite/c-c++-common/raw-string-10.c
new file mode 100644
index 000000000..76ed34e60
--- /dev/null
+++ b/gcc-4.9/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, "}");
+}