1 // PR preprocessor/57620
3 // { dg-require-effective-target wchar }
4 // { dg-options "-std=gnu99 -Wno-c++-compat -trigraphs" { target c } }
5 // { dg-options "-std=c++11" { target c++ } }
10 typedef __CHAR16_TYPE__ char16_t
;
11 typedef __CHAR32_TYPE__ char32_t
;
24 const char s00
[] = R
"??=??(??<??>??)??'??!??-\
27 const char s01[] = R"a(
31 const char s02
[] = R
"a(
35 const char s03[] = R"ab(
39 const char s04
[] = R
"a??/(x)a??/";
40 const char s05
[] = R
"abcdefghijklmn??(abc)abcdefghijklmn??";
41 const char s06
[] = R
"abcdefghijklm??/(abc)abcdefghijklm??/";
42 const char s07
[] = R
"abc(??)\
44 const char s08[] = R"def(de
)\
46 const char s09
[] = R
"a(??)\
49 const char s10[] = R"a(??)a\
52 const char s11
[] = R
"ab(??)a\
55 const char s12[] = R"a
#(a#)a??=)a#";
56 const char s13[] = R"a#(??)a??=??)a#";
57 const char s14[] = R"??/(x)??/
59 const char s15
[] = R
"??/(??)??/
61 const char s16[] = R"??(??)??";
62 const char s17[] = R"?(?)??)?";
63 const char s18[] = R"??(??)??)??)??";
65 const char u800[] = u8R"??=??(??<??>??)??'??!??-\
68 const char u801[] = u8R"a(
72 const char u802[] = u8R"a(
76 const char u803[] = u8R"ab(
80 const char u804[] = u8R"a??/(x)a??/";
81 const char u805[] = u8R"abcdefghijklmn??(abc)abcdefghijklmn??";
82 const char u806[] = u8R"abcdefghijklm??/(abc)abcdefghijklm??/";
83 const char u807[] = u8R"abc(??)\
85 const char u808[] = u8R"def(de)\
87 const char u809[] = u8R"a(??)\
90 const char u810[] = u8R"a(??)a\
93 const char u811[] = u8R"ab(??)a\
96 const char u812[] = u8R"a#(a#)a??=)a#";
97 const char u813[] = u8R"a#(??)a??=??)a#";
98 const char u814[] = u8R"??/(x)??/
100 const char u815[] = u8R"??/(??)??/
102 const char u816[] = u8R"??(??)??";
103 const char u817[] = u8R"?(?)??)?";
104 const char u818[] = u8R"??(??)??)??)??";
106 const char16_t u00[] = uR"??=??(??<??>??)??'??!??-\
109 const char16_t u01
[] = uR
"a(
113 const char16_t u02[] = uR"a(
117 const char16_t u03
[] = uR
"ab(
121 const char16_t u04[] = uR"a
??/(x
)a
??/";
122 const char16_t u05[] = uR"abcdefghijklmn
??(abc
)abcdefghijklmn
??";
123 const char16_t u06[] = uR"abcdefghijklm
??/(abc
)abcdefghijklm
??/";
124 const char16_t u07[] = uR"abc(??)\
126 const char16_t u08
[] = uR
"def(de)\
128 const char16_t u09[] = uR"a(??)\
131 const char16_t u10
[] = uR
"a(??)a\
134 const char16_t u11[] = uR"ab(??)a\
137 const char16_t u12
[] = uR
"a#(a#)a??=)a#";
138 const char16_t u13
[] = uR
"a#(??)a??=??)a#";
139 const char16_t u14
[] = uR
"??/(x)??/
141 const char16_t u15[] = uR"??/(??)??/
143 const char16_t u16
[] = uR
"??(??)??";
144 const char16_t u17
[] = uR
"?(?)??)?";
145 const char16_t u18
[] = uR
"??(??)??)??)??";
147 const char32_t U00
[] = UR
"??=??(??<??>??)??'??!??-\
150 const char32_t U01[] = UR"a(
154 const char32_t U02
[] = UR
"a(
158 const char32_t U03[] = UR"ab(
162 const char32_t U04
[] = UR
"a??/(x)a??/";
163 const char32_t U05
[] = UR
"abcdefghijklmn??(abc)abcdefghijklmn??";
164 const char32_t U06
[] = UR
"abcdefghijklm??/(abc)abcdefghijklm??/";
165 const char32_t U07
[] = UR
"abc(??)\
167 const char32_t U08[] = UR"def(de
)\
169 const char32_t U09
[] = UR
"a(??)\
172 const char32_t U10[] = UR"a(??)a\
175 const char32_t U11
[] = UR
"ab(??)a\
178 const char32_t U12[] = UR"a
#(a#)a??=)a#";
179 const char32_t U13[] = UR"a#(??)a??=??)a#";
180 const char32_t U14[] = UR"??/(x)??/
182 const char32_t U15
[] = UR
"??/(??)??/
184 const char32_t U16[] = UR"??(??)??";
185 const char32_t U17[] = UR"?(?)??)?";
186 const char32_t U18[] = UR"??(??)??)??)??";
188 const wchar_t L00[] = LR"??=??(??<??>??)??'??!??-\
191 const wchar_t L01[] = LR"a(
195 const wchar_t L02[] = LR"a(
199 const wchar_t L03[] = LR"ab(
203 const wchar_t L04[] = LR"a??/(x)a??/";
204 const wchar_t L05[] = LR"abcdefghijklmn??(abc)abcdefghijklmn??";
205 const wchar_t L06[] = LR"abcdefghijklm??/(abc)abcdefghijklm??/";
206 const wchar_t L07[] = LR"abc(??)\
208 const wchar_t L08[] = LR"def(de)\
210 const wchar_t L09[] = LR"a(??)\
213 const wchar_t L10[] = LR"a(??)a\
216 const wchar_t L11[] = LR"ab(??)a\
219 const wchar_t L12[] = LR"a#(a#)a??=)a#";
220 const wchar_t L13[] = LR"a#(??)a??=??)a#";
221 const wchar_t L14[] = LR"??/(x)??/
223 const wchar_t L15[] = LR"??/(??)??/
225 const wchar_t L16[] = LR"??(??)??";
226 const wchar_t L17[] = LR"?(?)??)?";
227 const wchar_t L18[] = LR"??(??)??)??)??";
232 #define TEST(str, val) \
233 if (sizeof (str) != sizeof (val) \
234 || __builtin_memcmp (str, val, sizeof (str)) != 0) \
236 TEST (s00, "??""<??"">??"")??""'??""!??""-\\\n(a
)#[{}]^|~\";\n");
237 TEST (s01, "\n)\\\na\"\n");
238 TEST (s02, "\n)a\\\n\"\n");
239 TEST (s03, "\n)a\\\nb\"\n");
243 TEST (s07, "??"")\\\nabc\";");
244 TEST (s08, "de)\\\ndef\";");
245 TEST (s09, "??"")\\\na\"\n");
246 TEST (s10, "??"")a\\\n\"\n");
247 TEST (s11, "??"")a\\\nb\"\n");
248 TEST (s12, "a#)a??""=");
249 TEST (s13, "??"")a??""=??");
250 TEST (s14, "x)??""/\n\";");
251 TEST (s15, "??"")??""/\n\";");
254 TEST (s18, "??"")??"")??");
255 TEST (u800, u8"??""<??"">??"")??""'??""!??""-\\\n(a)#[{}]^|~\";\n");
256 TEST (u801, u8"\n)\\\na\"\n");
257 TEST (u802, u8"\n)a\\\n\"\n");
258 TEST (u803, u8"\n)a\\\nb\"\n");
260 TEST (u805, u8"abc");
261 TEST (u806, u8"abc");
262 TEST (u807, u8"??"")\\\nabc\";");
263 TEST (u808, u8"de)\\\ndef\";");
264 TEST (u809, u8"??"")\\\na\"\n");
265 TEST (u810, u8"??"")a\\\n\"\n");
266 TEST (u811, u8"??"")a\\\nb\"\n");
267 TEST (u812, u8"a#)a??""=");
268 TEST (u813, u8"??"")a??""=??");
269 TEST (u814, u8"x)??""/\n\";");
270 TEST (u815, u8"??"")??""/\n\";");
272 TEST (u817, u8"?)??");
273 TEST (u818, u8"??"")??"")??");
274 TEST (u00, u"??""<??"">??"")??""'??""!??""-\\\n(a)#[{}]^|~\";\n");
275 TEST (u01, u"\n)\\\na\"\n");
276 TEST (u02, u"\n)a\\\n\"\n");
277 TEST (u03, u"\n)a\\\nb\"\n");
281 TEST (u07, u"??"")\\\nabc\";");
282 TEST (u08, u"de)\\\ndef\";");
283 TEST (u09, u"??"")\\\na\"\n");
284 TEST (u10, u"??"")a\\\n\"\n");
285 TEST (u11, u"??"")a\\\nb\"\n");
286 TEST (u12, u"a#)a??""=");
287 TEST (u13, u"??"")a??""=??");
288 TEST (u14, u"x)??""/\n\";");
289 TEST (u15, u"??"")??""/\n\";");
292 TEST (u18, u"??"")??"")??");
293 TEST (U00, U"??""<??"">??"")??""'??""!??""-\\\n(a)#[{}]^|~\";\n");
294 TEST (U01, U"\n)\\\na\"\n");
295 TEST (U02, U"\n)a\\\n\"\n");
296 TEST (U03, U"\n)a\\\nb\"\n");
300 TEST (U07, U"??"")\\\nabc\";");
301 TEST (U08, U"de)\\\ndef\";");
302 TEST (U09, U"??"")\\\na\"\n");
303 TEST (U10, U"??"")a\\\n\"\n");
304 TEST (U11, U"??"")a\\\nb\"\n");
305 TEST (U12, U"a#)a??""=");
306 TEST (U13, U"??"")a??""=??");
307 TEST (U14, U"x)??""/\n\";");
308 TEST (U15, U"??"")??""/\n\";");
311 TEST (U18, U"??"")??"")??");
312 TEST (L00, L"??""<??"">??"")??""'??""!??""-\\\n(a)#[{}]^|~\";\n");
313 TEST (L01, L"\n)\\\na\"\n");
314 TEST (L02, L"\n)a\\\n\"\n");
315 TEST (L03, L"\n)a\\\nb\"\n");
319 TEST (L07, L"??"")\\\nabc\";");
320 TEST (L08, L"de)\\\ndef\";");
321 TEST (L09, L"??"")\\\na\"\n");
322 TEST (L10, L"??"")a\\\n\"\n");
323 TEST (L11, L"??"")a\\\nb\"\n");
324 TEST (L12, L"a#)a??""=");
325 TEST (L13, L"??"")a??""=??");
326 TEST (L14, L"x)??""/\n\";");
327 TEST (L15, L"??"")??""/\n\";");
330 TEST (L18, L"??"")??"")??");