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 char16_t u00[] = uR"??=??(??<??>??)??'??!??-\
68 const char16_t u01[] = uR"a(
72 const char16_t u02[] = uR"a(
76 const char16_t u03[] = uR"ab(
80 const char16_t u04[] = uR"a??/(x)a??/";
81 const char16_t u05[] = uR"abcdefghijklmn??(abc)abcdefghijklmn??";
82 const char16_t u06[] = uR"abcdefghijklm??/(abc)abcdefghijklm??/";
83 const char16_t u07[] = uR"abc(??)\
85 const char16_t u08[] = uR"def(de)\
87 const char16_t u09[] = uR"a(??)\
90 const char16_t u10[] = uR"a(??)a\
93 const char16_t u11[] = uR"ab(??)a\
96 const char16_t u12[] = uR"a#(a#)a??=)a#";
97 const char16_t u13[] = uR"a#(??)a??=??)a#";
98 const char16_t u14[] = uR"??/(x)??/
100 const char16_t u15[] = uR"??/(??)??/
102 const char16_t u16[] = uR"??(??)??";
103 const char16_t u17[] = uR"?(?)??)?";
104 const char16_t u18[] = uR"??(??)??)??)??";
106 const char32_t U00[] = UR"??=??(??<??>??)??'??!??-\
109 const char32_t U01
[] = UR
"a(
113 const char32_t U02[] = UR"a(
117 const char32_t U03
[] = UR
"ab(
121 const char32_t U04[] = UR"a
??/(x
)a
??/";
122 const char32_t U05[] = UR"abcdefghijklmn
??(abc
)abcdefghijklmn
??";
123 const char32_t U06[] = UR"abcdefghijklm
??/(abc
)abcdefghijklm
??/";
124 const char32_t U07[] = UR"abc(??)\
126 const char32_t U08
[] = UR
"def(de)\
128 const char32_t U09[] = UR"a(??)\
131 const char32_t U10
[] = UR
"a(??)a\
134 const char32_t U11[] = UR"ab(??)a\
137 const char32_t U12
[] = UR
"a#(a#)a??=)a#";
138 const char32_t U13
[] = UR
"a#(??)a??=??)a#";
139 const char32_t U14
[] = UR
"??/(x)??/
141 const char32_t U15[] = UR"??/(??)??/
143 const char32_t U16
[] = UR
"??(??)??";
144 const char32_t U17
[] = UR
"?(?)??)?";
145 const char32_t U18
[] = UR
"??(??)??)??)??";
147 const wchar_t L00
[] = LR
"??=??(??<??>??)??'??!??-\
150 const wchar_t L01[] = LR"a(
154 const wchar_t L02
[] = LR
"a(
158 const wchar_t L03[] = LR"ab(
162 const wchar_t L04
[] = LR
"a??/(x)a??/";
163 const wchar_t L05
[] = LR
"abcdefghijklmn??(abc)abcdefghijklmn??";
164 const wchar_t L06
[] = LR
"abcdefghijklm??/(abc)abcdefghijklm??/";
165 const wchar_t L07
[] = LR
"abc(??)\
167 const wchar_t L08[] = LR"def(de
)\
169 const wchar_t L09
[] = LR
"a(??)\
172 const wchar_t L10[] = LR"a(??)a\
175 const wchar_t L11
[] = LR
"ab(??)a\
178 const wchar_t L12[] = LR"a
#(a#)a??=)a#";
179 const wchar_t L13[] = LR"a#(??)a??=??)a#";
180 const wchar_t L14[] = LR"??/(x)??/
182 const wchar_t L15
[] = LR
"??/(??)??/
184 const wchar_t L16[] = LR"??(??)??";
185 const wchar_t L17[] = LR"?(?)??)?";
186 const wchar_t L18[] = LR"??(??)??)??)??";
191 #define TEST(str, val) \
192 if (sizeof (str) != sizeof (val) \
193 || __builtin_memcmp (str, val, sizeof (str)) != 0) \
195 TEST (s00, "??""<??"">??"")??""'??""!??""-\\\n(a)#[{}]^|~\";\n");
196 TEST (s01, "\n)\\\na\"\n");
197 TEST (s02, "\n)a\\\n\"\n");
198 TEST (s03, "\n)a\\\nb\"\n");
202 TEST (s07, "??"")\\\nabc\";");
203 TEST (s08, "de)\\\ndef\";");
204 TEST (s09, "??"")\\\na\"\n");
205 TEST (s10, "??"")a\\\n\"\n");
206 TEST (s11, "??"")a\\\nb\"\n");
207 TEST (s12, "a#)a??""=");
208 TEST (s13, "??"")a??""=??");
209 TEST (s14, "x)??""/\n\";");
210 TEST (s15, "??"")??""/\n\";");
213 TEST (s18, "??"")??"")??");
214 TEST (u00, u"??""<??"">??"")??""'??""!??""-\\\n(a
)#[{}]^|~\";\n");
215 TEST (u01, u"\n)\\\na\"\n");
216 TEST (u02, u"\n)a\\\n\"\n");
217 TEST (u03, u"\n)a\\\nb\"\n");
221 TEST (u07, u"??"")\\\nabc\";");
222 TEST (u08, u"de)\\\ndef\";");
223 TEST (u09, u"??"")\\\na\"\n");
224 TEST (u10, u"??"")a\\\n\"\n");
225 TEST (u11, u"??"")a\\\nb\"\n");
226 TEST (u12, u"a#)a??""=");
227 TEST (u13, u"??"")a??""=??");
228 TEST (u14, u"x)??""/\n\";");
229 TEST (u15, u"??"")??""/\n\";");
232 TEST (u18, u"??"")??"")??");
233 TEST (U00, U"??""<??"">??"")??""'??""!??""-\\\n(a)#[{}]^|~\";\n");
234 TEST (U01, U"\n)\\\na\"\n");
235 TEST (U02, U"\n)a\\\n\"\n");
236 TEST (U03, U"\n)a\\\nb\"\n");
240 TEST (U07, U"??"")\\\nabc\";");
241 TEST (U08, U"de)\\\ndef\";");
242 TEST (U09, U"??"")\\\na\"\n");
243 TEST (U10, U"??"")a\\\n\"\n");
244 TEST (U11, U"??"")a\\\nb\"\n");
245 TEST (U12, U"a#)a??""=");
246 TEST (U13, U"??"")a??""=??");
247 TEST (U14, U"x)??""/\n\";");
248 TEST (U15, U"??"")??""/\n\";");
251 TEST (U18, U"??"")??"")??");
252 TEST (L00, L"??""<??"">??"")??""'??""!??""-\\\n(a)#[{}]^|~\";\n");
253 TEST (L01, L"\n)\\\na\"\n");
254 TEST (L02, L"\n)a\\\n\"\n");
255 TEST (L03, L"\n)a\\\nb\"\n");
259 TEST (L07, L"??"")\\\nabc\";");
260 TEST (L08, L"de)\\\ndef\";");
261 TEST (L09, L"??"")\\\na\"\n");
262 TEST (L10, L"??"")a\\\n\"\n");
263 TEST (L11, L"??"")a\\\nb\"\n");
264 TEST (L12, L"a#)a??""=");
265 TEST (L13, L"??"")a??""=??");
266 TEST (L14, L"x)??""/\n\";");
267 TEST (L15, L"??"")??""/\n\";");
270 TEST (L18, L"??"")??"")??");