2 // { dg-require-effective-target wchar }
3 // { dg-options "-std=gnu99 -Wno-c++-compat -trigraphs" { target c } }
4 // { dg-options "-std=c++0x" { target c++ } }
9 typedef __CHAR16_TYPE__ char16_t
;
10 typedef __CHAR32_TYPE__ char32_t
;
13 const char s0
[] = R
"(a\
14 \u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\
0\
00\000\xa
\xabb
16 const char s1[] = "a
\\\n\\u010d
\\U0000010D
\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
17 const char s2[] = R"*|*(a\
22 const char s3[] = "a\\\nb\nc)\"\nc)*|\"\nc";
23 // The ) in ??) below is part of the raw string suffix )".
24 const char s4[] = R"(??/
26 ??(??<??=??'??!??-??>??)";
27 const char s5[] = "?\?/\n?\?/\n?\?(?\?<?\?=?\?'?\?!?\?-?\?>?\?";
29 const char t0[] = u8R"(a\
30 \u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
32 const char t1[] = u8"a\\\n\\u010d\\U0000010D\\\\\\'\\\"\\?\\a
\\b
\\f
\\n
\\r
\\t
\\v
\\0\\00\\000\\xa
\\xabb
\nc
";
33 const char t2[] = u8R"*|*(a\
38 const char t3[] = u8"a
\\\nb
\nc
)\"\nc
)*|\"\nc
";
39 const char t4[] = u8R"(??/
41 ??(??<??=??'??!??-??>??)";
42 const char t5[] = u8"?\?/\n?\?/\n?\?(?\?<?\?=?\?'?\?!?\?-?\?>?\?";
44 const char16_t u0[] = uR"(a\
45 \u010d\U0000010D
\\\'\"\?\a\b\f\n\r\t\v\
0\
00\000\xa
\xabb
47 const char16_t u1[] = u"a
\\\n\\u010d
\\U0000010D
\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
48 const char16_t u2[] = uR"*|*(a\
53 const char16_t u3[] = u"a\\\nb\nc)\"\nc)*|\"\nc";
54 const char16_t u4[] = uR"(??/
56 ??(??<??=??'??!??-??>??)";
57 const char16_t u5[] = u"?\?/\n?\?/\n?\?(?\?<?\?=?\?'?\?!?\?-?\?>?\?";
59 const char32_t U0[] = UR"(a\
60 \u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
62 const char32_t U1[] = U"a\\\n\\u010d\\U0000010D\\\\\\'\\\"\\?\\a
\\b
\\f
\\n
\\r
\\t
\\v
\\0\\00\\000\\xa
\\xabb
\nc
";
63 const char32_t U2[] = UR"*|*(a\
68 const char32_t U3[] = U"a
\\\nb
\nc
)\"\nc
)*|\"\nc
";
69 const char32_t U4[] = UR"(??/
71 ??(??<??=??'??!??-??>??)";
72 const char32_t U5[] = U"?\?/\n?\?/\n?\?(?\?<?\?=?\?'?\?!?\?-?\?>?\?";
74 const wchar_t L0[] = LR"(a\
75 \u010d\U0000010D
\\\'\"\?\a\b\f\n\r\t\v\
0\
00\000\xa
\xabb
77 const wchar_t L1[] = L"a
\\\n\\u010d
\\U0000010D
\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
78 const wchar_t L2[] = LR"*|*(a\
83 const wchar_t L3[] = L"a\\\nb\nc)\"\nc)*|\"\nc";
84 const wchar_t L4[] = LR"(??/
86 ??(??<??=??'??!??-??>??)";
87 const wchar_t L5[] = L"?\?/\n?\?/\n?\?(?\?<?\?=?\?'?\?!?\?-?\?>?\?";
92 if (sizeof (s0) != sizeof (s1)
93 || __builtin_memcmp (s0, s1, sizeof (s0)) != 0)
95 if (sizeof (s2) != sizeof (s3)
96 || __builtin_memcmp (s2, s3, sizeof (s2)) != 0)
98 if (sizeof (s4) != sizeof (s5)
99 || __builtin_memcmp (s4, s5, sizeof (s4)) != 0)
101 if (sizeof (t0) != sizeof (t1)
102 || __builtin_memcmp (t0, t1, sizeof (t0)) != 0)
104 if (sizeof (t2) != sizeof (t3)
105 || __builtin_memcmp (t2, t3, sizeof (t2)) != 0)
107 if (sizeof (t4) != sizeof (t5)
108 || __builtin_memcmp (t4, t5, sizeof (t4)) != 0)
110 if (sizeof (u0) != sizeof (u1)
111 || __builtin_memcmp (u0, u1, sizeof (u0)) != 0)
113 if (sizeof (u2) != sizeof (u3)
114 || __builtin_memcmp (u2, u3, sizeof (u2)) != 0)
116 if (sizeof (u4) != sizeof (u5)
117 || __builtin_memcmp (u4, u5, sizeof (u4)) != 0)
119 if (sizeof (U0) != sizeof (U1)
120 || __builtin_memcmp (U0, U1, sizeof (U0)) != 0)
122 if (sizeof (U2) != sizeof (U3)
123 || __builtin_memcmp (U2, U3, sizeof (U2)) != 0)
125 if (sizeof (U4) != sizeof (U5)
126 || __builtin_memcmp (U4, U5, sizeof (U4)) != 0)
128 if (sizeof (L0) != sizeof (L1)
129 || __builtin_memcmp (L0, L1, sizeof (L0)) != 0)
131 if (sizeof (L2) != sizeof (L3)
132 || __builtin_memcmp (L2, L3, sizeof (L2)) != 0)
134 if (sizeof (L4) != sizeof (L5)
135 || __builtin_memcmp (L4, L5, sizeof (L4)) != 0)
137 if (sizeof (R"*()*") != 1
138 || __builtin_memcmp (R"*()*", "", 1) != 0)