aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/raw-string-9.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/raw-string-9.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/raw-string-9.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/raw-string-9.c b/gcc-4.9/gcc/testsuite/c-c++-common/raw-string-9.c
new file mode 100644
index 000000000..6ba6b1a33
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/raw-string-9.c
@@ -0,0 +1,19 @@
+// Make sure that we properly handle trigraphs in raw strings when
+// trigraphs are disabled, too.
+// { dg-options "-std=gnu99" { target c } }
+// { dg-options "-std=gnu++0x" { target c++ } }
+// { dg-do run }
+
+const char b[] = "??>"; // { dg-message "-trigraphs" }
+const char a[] = R"(??>??)??/
+??)";
+
+#define TEST(str, val) \
+ if (sizeof (str) != sizeof (val) \
+ || __builtin_memcmp (str, val, sizeof (str)) != 0) \
+ __builtin_abort ()
+
+int main()
+{
+ TEST (a, "?\?>?\?)?\?/\n?\?");
+}