+2010-03-29 Jason Merrill <jason@redhat.com>
+
+ * c-c++-common/raw-string-1.c: Combine C and C++ raw string tests.
+ * c-c++-common/raw-string-2.c: Combine C and C++ raw string tests.
+ * c-c++-common/raw-string-3.c: Combine C and C++ raw string tests.
+ * c-c++-common/raw-string-4.c: Combine C and C++ raw string tests.
+ * c-c++-common/raw-string-5.c: Combine C and C++ raw string tests.
+ * c-c++-common/raw-string-6.c: Combine C and C++ raw string tests.
+ * c-c++-common/raw-string-7.c: Combine C and C++ raw string tests.
+
2010-03-29 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43560
// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-require-effective-target wchar }
+// { dg-options "-std=gnu99 -Wno-c++-compat" { target c } }
+// { dg-options "-std=c++0x" { target c++ } }
+
+#ifndef __cplusplus
+#include <wchar.h>
+
+typedef __CHAR16_TYPE__ char16_t;
+typedef __CHAR32_TYPE__ char32_t;
+#endif
const char s0[] = R"(a\
\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-require-effective-target wchar }
+// { dg-options "-std=gnu99 -Wno-c++-compat" { target c } }
+// { dg-options "-std=c++0x" { target c++ } }
+
+#ifndef __cplusplus
+#include <wchar.h>
+
+typedef __CHAR16_TYPE__ char16_t;
+typedef __CHAR32_TYPE__ char32_t;
+#endif
#define R
#define u
--- /dev/null
+// If not c++0x/gnu99, the {,u,u8,U,L}R prefix should be parsed as separate
+// token.
+// { dg-do compile }
+// { dg-options "" { target c } }
+// { dg-options "-std=c++98" { target c++ } }
+
+const void *s0 = R"(a)"; // { dg-error "was not declared|undeclared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 7 }
+const void *s1 = uR"(a)"; // { dg-error "was not declared|undeclared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 9 }
+const void *s2 = UR"(a)"; // { dg-error "was not declared|undeclared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 11 }
+const void *s3 = u8R"(a)"; // { dg-error "was not declared|undeclared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 13 }
+const void *s4 = LR"(a)"; // { dg-error "was not declared|undeclared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 15 }
+
+const int i0 = R'a'; // { dg-error "expected ',' or ';'" }
+ // { dg-error "was not declared" "" { target c++ } 18 }
+const int i1 = uR'a'; // { dg-error "expected ',' or ';'" }
+ // { dg-error "was not declared" "" { target c++ } 20 }
+const int i2 = UR'a'; // { dg-error "expected ',' or ';'" }
+ // { dg-error "was not declared" "" { target c++ } 22 }
+const int i3 = u8R'a'; // { dg-error "expected ',' or ';'" }
+ // { dg-error "was not declared" "" { target c++ } 24 }
+const int i4 = LR'a'; // { dg-error "expected ',' or ';'" }
+ // { dg-error "was not declared" "" { target c++ } 26 }
+
+#define R "a"
+#define uR "b"
+#define UR "c"
+#define u8R "d"
+#define LR "e"
+
+const void *s5 = R"(a)";
+const void *s6 = uR"(a)";
+const void *s7 = UR"(a)";
+const void *s8 = u8R"(a)";
+const void *s9 = LR"(a)";
+
+#undef R
+#undef uR
+#undef UR
+#undef u8R
+#undef LR
+
+#define R 1 +
+#define uR 2 +
+#define UR 3 +
+#define u8R 4 +
+#define LR 5 +
+
+const int i5 = R'a';
+const int i6 = uR'a';
+const int i7 = UR'a';
+const int i8 = u8R'a';
+const int i9 = LR'a';
+
+int main () {}
--- /dev/null
+// R is not applicable for character literals.
+// { dg-do compile }
+// { dg-options "-std=gnu99" { target c } }
+// { dg-options "-std=c++0x" { target c++ } }
+
+const int i0 = R'a'; // { dg-error "was not declared|undeclared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 6 }
+const int i1 = uR'a'; // { dg-error "was not declared|undeclared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 8 }
+const int i2 = UR'a'; // { dg-error "was not declared|undeclared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 10 }
+const int i3 = u8R'a'; // { dg-error "was not declared|undeclared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 12 }
+const int i4 = LR'a'; // { dg-error "was not declared|undeclared" }
+ // { dg-error "expected ',' or ';'" "" { target *-*-* } 14 }
+
+#define R 1 +
+#define uR 2 +
+#define UR 3 +
+#define u8R 4 +
+#define LR 5 +
+
+const int i5 = R'a';
+const int i6 = uR'a';
+const int i7 = UR'a';
+const int i8 = u8R'a';
+const int i9 = LR'a';
+
+int main () {}
--- /dev/null
+// { dg-do compile }
+// { dg-options "-std=gnu99" { target c } }
+// { dg-options "-std=c++0x" { target c++ } }
+
+const void *s0 = R"0123456789abcdefg()0123456789abcdefg";
+ // { dg-error "raw string delimiter longer" "" { target *-*-* } 5 }
+ // { dg-error "stray" "" { target *-*-* } 5 }
+const void *s1 = R" () ";
+ // { dg-error "invalid character" "" { target *-*-* } 8 }
+ // { dg-error "stray" "" { target *-*-* } 8 }
+const void *s2 = R" () ";
+ // { dg-error "invalid character" "" { target *-*-* } 11 }
+ // { dg-error "stray" "" { target *-*-* } 11 }
+const void *s3 = R")())";
+ // { dg-error "invalid character" "" { target *-*-* } 14 }
+ // { dg-error "stray" "" { target *-*-* } 14 }
+const void *s4 = R"@()@";
+ // { dg-error "invalid character" "" { target *-*-* } 17 }
+ // { dg-error "stray" "" { target *-*-* } 17 }
+const void *s5 = R"$()$";
+ // { dg-error "invalid character" "" { target *-*-* } 20 }
+ // { dg-error "stray" "" { target *-*-* } 20 }
+const void *s6 = R"\u0040()\u0040";
+ // { dg-error "invalid character" "" { target *-*-* } 23 }
+ // { dg-error "stray" "" { target *-*-* } 23 }
+
+int main () {}
--- /dev/null
+// { dg-do compile }
+// { dg-options "-std=gnu99" { target c } }
+// { dg-options "-std=c++0x" { target c++ } }
+
+const void *s0 = R"ouch()ouCh"; // { dg-error "at end of input" }
+ // { dg-error "unterminated raw string" "" { target *-*-* } 5 }
// The trailing whitespace after \ and before newline extension
// breaks full compliance for raw strings.
// { dg-do run { xfail *-*-* } }
-// { dg-options "-std=c++0x" }
+// { dg-options "-std=gnu99" { target c } }
+// { dg-options "-std=c++0x" { target c++ } }
// Note, there is a single space after \ on the following line.
const char *s0 = R"(\
)";
-// { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 7 }
+// { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 8 }
// Note, there is a single tab after \ on the following line.
const char *s1 = R"(\
)";
-// { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 12 }
+// { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 13 }
int
main (void)
+++ /dev/null
-// If c++98, the {,u,u8,U,L}R prefix should be parsed as separate
-// token.
-// { dg-do compile }
-// { dg-options "-std=c++98" }
-
-const void *s0 = R"(a)"; // { dg-error "was not declared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 6 }
-const void *s1 = uR"(a)"; // { dg-error "was not declared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 8 }
-const void *s2 = UR"(a)"; // { dg-error "was not declared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 10 }
-const void *s3 = u8R"(a)"; // { dg-error "was not declared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 12 }
-const void *s4 = LR"(a)"; // { dg-error "was not declared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 14 }
-
-const int i0 = R'a'; // { dg-error "was not declared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 17 }
-const int i1 = uR'a'; // { dg-error "was not declared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 19 }
-const int i2 = UR'a'; // { dg-error "was not declared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 21 }
-const int i3 = u8R'a'; // { dg-error "was not declared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 23 }
-const int i4 = LR'a'; // { dg-error "was not declared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 25 }
-
-#define R "a"
-#define uR "b"
-#define UR "c"
-#define u8R "d"
-#define LR "e"
-
-const void *s5 = R"(a)";
-const void *s6 = uR"(a)";
-const void *s7 = UR"(a)";
-const void *s8 = u8R"(a)";
-const void *s9 = LR"(a)";
-
-#undef R
-#undef uR
-#undef UR
-#undef u8R
-#undef LR
-
-#define R 1 +
-#define uR 2 +
-#define UR 3 +
-#define u8R 4 +
-#define LR 5 +
-
-const int i5 = R'a';
-const int i6 = uR'a';
-const int i7 = UR'a';
-const int i8 = u8R'a';
-const int i9 = LR'a';
-
-int main () {}
+++ /dev/null
-// R is not applicable for character literals.
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
-
-const int i0 = R'a'; // { dg-error "was not declared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 5 }
-const int i1 = uR'a'; // { dg-error "was not declared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 7 }
-const int i2 = UR'a'; // { dg-error "was not declared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 9 }
-const int i3 = u8R'a'; // { dg-error "was not declared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 11 }
-const int i4 = LR'a'; // { dg-error "was not declared" }
- // { dg-error "expected ',' or ';'" "" { target *-*-* } 13 }
-
-#define R 1 +
-#define uR 2 +
-#define UR 3 +
-#define u8R 4 +
-#define LR 5 +
-
-const int i5 = R'a';
-const int i6 = uR'a';
-const int i7 = UR'a';
-const int i8 = u8R'a';
-const int i9 = LR'a';
-
-int main () {}
+++ /dev/null
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
-
-const void *s0 = R"0123456789abcdefg()0123456789abcdefg";
- // { dg-error "raw string delimiter longer" "" { target *-*-* } 4 }
- // { dg-error "stray" "" { target *-*-* } 4 }
-const void *s1 = R" () ";
- // { dg-error "invalid character" "" { target *-*-* } 7 }
- // { dg-error "stray" "" { target *-*-* } 7 }
-const void *s2 = R" () ";
- // { dg-error "invalid character" "" { target *-*-* } 10 }
- // { dg-error "stray" "" { target *-*-* } 10 }
-const void *s3 = R")())";
- // { dg-error "invalid character" "" { target *-*-* } 13 }
- // { dg-error "stray" "" { target *-*-* } 13 }
-const void *s4 = R"@()@";
- // { dg-error "invalid character" "" { target *-*-* } 16 }
- // { dg-error "stray" "" { target *-*-* } 16 }
-const void *s5 = R"$()$";
- // { dg-error "invalid character" "" { target *-*-* } 19 }
- // { dg-error "stray" "" { target *-*-* } 19 }
-const void *s6 = R"\u0010()\u0010";
- // { dg-error "invalid character" "" { target *-*-* } 22 }
- // { dg-error "stray" "" { target *-*-* } 22 }
-
-int main () {}
+++ /dev/null
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
-
-const void *s0 = R"ouch()ouCh"; // { dg-error "at end of input" }
- // { dg-error "unterminated raw string" "" { target *-*-* } 4 }
+++ /dev/null
-/* { dg-do run } */
-/* { dg-require-effective-target wchar } */
-/* { dg-options "-std=gnu99" } */
-
-#include <wchar.h>
-
-typedef __CHAR16_TYPE__ char16_t;
-typedef __CHAR32_TYPE__ char32_t;
-
-const char s0[] = R"[a\
-\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
-c]";
-const char s1[] = "a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
-const char s2[] = R"*|*[a\
-b
-c]"
-c]*|"
-c]*|*";
-const char s3[] = "ab\nc]\"\nc]*|\"\nc";
-
-const char t0[] = u8R"[a\
-\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
-c]";
-const char t1[] = u8"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
-const char t2[] = u8R"*|*[a\
-b
-c]"
-c]*|"
-c]*|*";
-const char t3[] = u8"ab\nc]\"\nc]*|\"\nc";
-
-const char16_t u0[] = uR"[a\
-\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
-c]";
-const char16_t u1[] = u"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
-const char16_t u2[] = uR"*|*[a\
-b
-c]"
-c]*|"
-c]*|*";
-const char16_t u3[] = u"ab\nc]\"\nc]*|\"\nc";
-
-const char32_t U0[] = UR"[a\
-\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
-c]";
-const char32_t U1[] = U"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
-const char32_t U2[] = UR"*|*[a\
-b
-c]"
-c]*|"
-c]*|*";
-const char32_t U3[] = U"ab\nc]\"\nc]*|\"\nc";
-
-const wchar_t L0[] = LR"[a\
-\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
-c]";
-const wchar_t L1[] = L"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
-const wchar_t L2[] = LR"*|*[a\
-b
-c]"
-c]*|"
-c]*|*";
-const wchar_t L3[] = L"ab\nc]\"\nc]*|\"\nc";
-
-int
-main (void)
-{
- if (sizeof (s0) != sizeof (s1)
- || __builtin_memcmp (s0, s1, sizeof (s0)) != 0)
- __builtin_abort ();
- if (sizeof (s2) != sizeof (s3)
- || __builtin_memcmp (s2, s3, sizeof (s2)) != 0)
- __builtin_abort ();
- if (sizeof (t0) != sizeof (t1)
- || __builtin_memcmp (t0, t1, sizeof (t0)) != 0)
- __builtin_abort ();
- if (sizeof (t2) != sizeof (t3)
- || __builtin_memcmp (t2, t3, sizeof (t2)) != 0)
- __builtin_abort ();
- if (sizeof (u0) != sizeof (u1)
- || __builtin_memcmp (u0, u1, sizeof (u0)) != 0)
- __builtin_abort ();
- if (sizeof (u2) != sizeof (u3)
- || __builtin_memcmp (u2, u3, sizeof (u2)) != 0)
- __builtin_abort ();
- if (sizeof (U0) != sizeof (U1)
- || __builtin_memcmp (U0, U1, sizeof (U0)) != 0)
- __builtin_abort ();
- if (sizeof (U2) != sizeof (U3)
- || __builtin_memcmp (U2, U3, sizeof (U2)) != 0)
- __builtin_abort ();
- if (sizeof (L0) != sizeof (L1)
- || __builtin_memcmp (L0, L1, sizeof (L0)) != 0)
- __builtin_abort ();
- if (sizeof (L2) != sizeof (L3)
- || __builtin_memcmp (L2, L3, sizeof (L2)) != 0)
- __builtin_abort ();
- if (sizeof (R"*[]*") != 1
- || __builtin_memcmp (R"*[]*", "", 1) != 0)
- __builtin_abort ();
- return 0;
-}
+++ /dev/null
-/* { dg-do run } */
-/* { dg-require-effective-target wchar } */
-/* { dg-options "-std=gnu99" } */
-
-#include <wchar.h>
-
-typedef __CHAR16_TYPE__ char16_t;
-typedef __CHAR32_TYPE__ char32_t;
-
-#define R
-#define u
-#define uR
-#define U
-#define UR
-#define u8
-#define u8R
-#define L
-#define LR
-
-const char s00[] = R"[a]" "[b]";
-const char s01[] = "[a]" R"*[b]*";
-const char s02[] = R"[a]" R"[b]";
-const char s03[] = R"-[a]-" u8"[b]";
-const char s04[] = "[a]" u8R"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ";
-const char s05[] = R"[a]" u8R"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL";
-const char s06[] = u8R";([a];(" "[b]";
-const char s07[] = u8"[a]" R"[b]";
-const char s08[] = u8R"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-";
-const char s09[] = u8R"/^&|~!=,"'\[a]/^&|~!=,"'\" u8"[b]";
-const char s10[] = u8"[a]" u8R"0123456789abcdef[b]0123456789abcdef";
-const char s11[] = u8R"ghijklmnopqrstuv[a]ghijklmnopqrstuv" u8R"w[b]w";
-
-const char16_t u03[] = R"-[a]-" u"[b]";
-const char16_t u04[] = "[a]" uR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ";
-const char16_t u05[] = R"[a]" uR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL";
-const char16_t u06[] = uR";([a];(" "[b]";
-const char16_t u07[] = u"[a]" R"[b]";
-const char16_t u08[] = uR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-";
-const char16_t u09[] = uR"/^&|~!=,"'\[a]/^&|~!=,"'\" u"[b]";
-const char16_t u10[] = u"[a]" uR"0123456789abcdef[b]0123456789abcdef";
-const char16_t u11[] = uR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" uR"w[b]w";
-
-const char32_t U03[] = R"-[a]-" U"[b]";
-const char32_t U04[] = "[a]" UR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ";
-const char32_t U05[] = R"[a]" UR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL";
-const char32_t U06[] = UR";([a];(" "[b]";
-const char32_t U07[] = U"[a]" R"[b]";
-const char32_t U08[] = UR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-";
-const char32_t U09[] = UR"/^&|~!=,"'\[a]/^&|~!=,"'\" U"[b]";
-const char32_t U10[] = U"[a]" UR"0123456789abcdef[b]0123456789abcdef";
-const char32_t U11[] = UR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" UR"w[b]w";
-
-const wchar_t L03[] = R"-[a]-" L"[b]";
-const wchar_t L04[] = "[a]" LR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ";
-const wchar_t L05[] = R"[a]" LR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL";
-const wchar_t L06[] = LR";([a];(" "[b]";
-const wchar_t L07[] = L"[a]" R"[b]";
-const wchar_t L08[] = LR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-";
-const wchar_t L09[] = LR"/^&|~!=,"'\[a]/^&|~!=,"'\" L"[b]";
-const wchar_t L10[] = L"[a]" LR"0123456789abcdef[b]0123456789abcdef";
-const wchar_t L11[] = LR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" LR"w[b]w";
-
-int
-main (void)
-{
-#define TEST(str, val) \
- if (sizeof (str) != sizeof (val) \
- || __builtin_memcmp (str, val, sizeof (str)) != 0) \
- __builtin_abort ()
- TEST (s00, "a[b]");
- TEST (s01, "[a]b");
- TEST (s02, "ab");
- TEST (s03, "a[b]");
- TEST (s04, "[a]b");
- TEST (s05, "ab");
- TEST (s06, "a[b]");
- TEST (s07, "[a]b");
- TEST (s08, "ab");
- TEST (s09, "a[b]");
- TEST (s10, "[a]b");
- TEST (s11, "ab");
- TEST (u03, u"a[b]");
- TEST (u04, u"[a]b");
- TEST (u05, u"ab");
- TEST (u06, u"a[b]");
- TEST (u07, u"[a]b");
- TEST (u08, u"ab");
- TEST (u09, u"a[b]");
- TEST (u10, u"[a]b");
- TEST (u11, u"ab");
- TEST (U03, U"a[b]");
- TEST (U04, U"[a]b");
- TEST (U05, U"ab");
- TEST (U06, U"a[b]");
- TEST (U07, U"[a]b");
- TEST (U08, U"ab");
- TEST (U09, U"a[b]");
- TEST (U10, U"[a]b");
- TEST (U11, U"ab");
- TEST (L03, L"a[b]");
- TEST (L04, L"[a]b");
- TEST (L05, L"ab");
- TEST (L06, L"a[b]");
- TEST (L07, L"[a]b");
- TEST (L08, L"ab");
- TEST (L09, L"a[b]");
- TEST (L10, L"[a]b");
- TEST (L11, L"ab");
- return 0;
-}
+++ /dev/null
-/* If not gnu99, the {,u,u8,U,L}R prefix should be parsed as separate
- token. */
-/* { dg-do compile } */
-/* { dg-options "" } */
-
-const void *s0 = R"[a]"; /* { dg-error "undeclared" } */
- /* { dg-error "expected ',' or ';'" "" { target *-*-* } 6 } */
-const void *s1 = uR"[a]"; /* { dg-error "undeclared" } */
- /* { dg-error "expected ',' or ';'" "" { target *-*-* } 8 } */
-const void *s2 = UR"[a]"; /* { dg-error "undeclared" } */
- /* { dg-error "expected ',' or ';'" "" { target *-*-* } 10 } */
-const void *s3 = u8R"[a]"; /* { dg-error "undeclared" } */
- /* { dg-error "expected ',' or ';'" "" { target *-*-* } 12 } */
-const void *s4 = LR"[a]"; /* { dg-error "undeclared" } */
- /* { dg-error "expected ',' or ';'" "" { target *-*-* } 14 } */
-
-const int i0 = R'a'; /* { dg-error "expected ',' or ';'" } */
-const int i1 = uR'a'; /* { dg-error "expected ',' or ';'" } */
-const int i2 = UR'a'; /* { dg-error "expected ',' or ';'" } */
-const int i3 = u8R'a'; /* { dg-error "expected ',' or ';'" } */
-const int i4 = LR'a'; /* { dg-error "expected ',' or ';'" } */
-
-#define R "a"
-#define uR "b"
-#define UR "c"
-#define u8R "d"
-#define LR "e"
-
-const void *s5 = R"[a]";
-const void *s6 = uR"[a]";
-const void *s7 = UR"[a]";
-const void *s8 = u8R"[a]";
-const void *s9 = LR"[a]";
-
-#undef R
-#undef uR
-#undef UR
-#undef u8R
-#undef LR
-
-#define R 1 +
-#define uR 2 +
-#define UR 3 +
-#define u8R 4 +
-#define LR 5 +
-
-const int i5 = R'a';
-const int i6 = uR'a';
-const int i7 = UR'a';
-const int i8 = u8R'a';
-const int i9 = LR'a';
-
-int main () {}
+++ /dev/null
-/* R is not applicable for character literals. */
-/* { dg-do compile } */
-/* { dg-options "-std=gnu99" } */
-
-const int i0 = R'a'; /* { dg-error "undeclared" } */
- /* { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } */
-const int i1 = uR'a'; /* { dg-error "undeclared" } */
- /* { dg-error "expected ',' or ';'" "" { target *-*-* } 7 } */
-const int i2 = UR'a'; /* { dg-error "undeclared" } */
- /* { dg-error "expected ',' or ';'" "" { target *-*-* } 9 } */
-const int i3 = u8R'a'; /* { dg-error "undeclared" } */
- /* { dg-error "expected ',' or ';'" "" { target *-*-* } 11 } */
-const int i4 = LR'a'; /* { dg-error "undeclared" } */
- /* { dg-error "expected ',' or ';'" "" { target *-*-* } 13 } */
-
-#define R 1 +
-#define uR 2 +
-#define UR 3 +
-#define u8R 4 +
-#define LR 5 +
-
-const int i5 = R'a';
-const int i6 = uR'a';
-const int i7 = UR'a';
-const int i8 = u8R'a';
-const int i9 = LR'a';
-
-int main () {}
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-std=gnu99" } */
-
-const void *s0 = R"0123456789abcdefg[]0123456789abcdefg";
- /* { dg-error "raw string delimiter longer" "" { target *-*-* } 4 } */
- /* { dg-error "stray" "" { target *-*-* } 4 } */
-const void *s1 = R" [] ";
- /* { dg-error "invalid character" "" { target *-*-* } 7 } */
- /* { dg-error "stray" "" { target *-*-* } 7 } */
-const void *s2 = R" [] ";
- /* { dg-error "invalid character" "" { target *-*-* } 10 } */
- /* { dg-error "stray" "" { target *-*-* } 10 } */
-const void *s3 = R"][]]";
- /* { dg-error "invalid character" "" { target *-*-* } 13 } */
- /* { dg-error "stray" "" { target *-*-* } 13 } */
-const void *s4 = R"@[]@";
- /* { dg-error "invalid character" "" { target *-*-* } 16 } */
- /* { dg-error "stray" "" { target *-*-* } 16 } */
-const void *s5 = R"$[]$";
- /* { dg-error "invalid character" "" { target *-*-* } 19 } */
- /* { dg-error "stray" "" { target *-*-* } 19 } */
-
-int main () {}
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-std=gnu99" } */
-
-const void *s0 = R"ouch[]ouCh"; /* { dg-error "expected expression at end of input" } */
- /* { dg-error "unterminated raw string" "" { target *-*-* } 4 } */
+++ /dev/null
-/* The trailing whitespace after \ and before newline extension
- breaks full compliance for raw strings. */
-/* { dg-do run { xfail *-*-* } } */
-/* { dg-options "-std=gnu99" } */
-
-/* Note, there is a single space after \ on the following line. */
-const void *s0 = R"[\
-]";
-/* { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 7 } */
-
-/* Note, there is a single tab after \ on the following line. */
-const void *s1 = R"[\
-]";
-/* { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 12 } */
-
-int
-main (void)
-{
- if (__builtin_strcmp (s0, "\\ \n") != 0
- || __builtin_strcmp (s1, "\\\t\n") != 0)
- __builtin_abort ();
- return 0;
-}