Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / c-c++-common / raw-string-13.c
blobfa11edaa7aab28acfc509525849be8a60d86c309
1 // PR preprocessor/57620
2 // { dg-do run }
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++ } }
7 #ifndef __cplusplus
8 #include <wchar.h>
10 typedef __CHAR16_TYPE__ char16_t;
11 typedef __CHAR32_TYPE__ char32_t;
12 #endif
14 #define R
15 #define u
16 #define uR
17 #define U
18 #define UR
19 #define u8
20 #define u8R
21 #define L
22 #define LR
24 const char s00[] = R"??=??(??<??>??)??'??!??-\
25 (a)#[{}]^|~";
26 )??=??";
27 const char s01[] = R"a(
30 )a";
31 const char s02[] = R"a(
32 )a\
34 )a";
35 const char s03[] = R"ab(
36 )a\
38 )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(??)\
43 abc";)abc";
44 const char s08[] = R"def(de)\
45 def";)def";
46 const char s09[] = R"a(??)\
48 )a";
49 const char s10[] = R"a(??)a\
51 )a";
52 const char s11[] = R"ab(??)a\
54 )ab";
55 const char s12[] = R"a#(a#)a??=)a#";
56 const char s13[] = R"a#(??)a??=??)a#";
57 const char s14[] = R"??/(x)??/
58 ";)??/";
59 const char s15[] = R"??/(??)??/
60 ";)??/";
61 const char s16[] = R"??(??)??";
62 const char s17[] = R"?(?)??)?";
63 const char s18[] = R"??(??)??)??)??";
65 const char u800[] = u8R"??=??(??<??>??)??'??!??-\
66 (a)#[{}]^|~";
67 )??=??";
68 const char u801[] = u8R"a(
71 )a";
72 const char u802[] = u8R"a(
73 )a\
75 )a";
76 const char u803[] = u8R"ab(
77 )a\
79 )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(??)\
84 abc";)abc";
85 const char u808[] = u8R"def(de)\
86 def";)def";
87 const char u809[] = u8R"a(??)\
89 )a";
90 const char u810[] = u8R"a(??)a\
92 )a";
93 const char u811[] = u8R"ab(??)a\
95 )ab";
96 const char u812[] = u8R"a#(a#)a??=)a#";
97 const char u813[] = u8R"a#(??)a??=??)a#";
98 const char u814[] = u8R"??/(x)??/
99 ";)??/";
100 const char u815[] = u8R"??/(??)??/
101 ";)??/";
102 const char u816[] = u8R"??(??)??";
103 const char u817[] = u8R"?(?)??)?";
104 const char u818[] = u8R"??(??)??)??)??";
106 const char16_t u00[] = uR"??=??(??<??>??)??'??!??-\
107 (a)#[{}]^|~";
108 )??=??";
109 const char16_t u01[] = uR"a(
112 )a";
113 const char16_t u02[] = uR"a(
116 )a";
117 const char16_t u03[] = uR"ab(
120 )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(??)\
125 abc";)abc";
126 const char16_t u08[] = uR"def(de)\
127 def";)def";
128 const char16_t u09[] = uR"a(??)\
130 )a";
131 const char16_t u10[] = uR"a(??)a\
133 )a";
134 const char16_t u11[] = uR"ab(??)a\
136 )ab";
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)??/
140 ";)??/";
141 const char16_t u15[] = uR"??/(??)??/
142 ";)??/";
143 const char16_t u16[] = uR"??(??)??";
144 const char16_t u17[] = uR"?(?)??)?";
145 const char16_t u18[] = uR"??(??)??)??)??";
147 const char32_t U00[] = UR"??=??(??<??>??)??'??!??-\
148 (a)#[{}]^|~";
149 )??=??";
150 const char32_t U01[] = UR"a(
153 )a";
154 const char32_t U02[] = UR"a(
157 )a";
158 const char32_t U03[] = UR"ab(
161 )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(??)\
166 abc";)abc";
167 const char32_t U08[] = UR"def(de)\
168 def";)def";
169 const char32_t U09[] = UR"a(??)\
171 )a";
172 const char32_t U10[] = UR"a(??)a\
174 )a";
175 const char32_t U11[] = UR"ab(??)a\
177 )ab";
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)??/
181 ";)??/";
182 const char32_t U15[] = UR"??/(??)??/
183 ";)??/";
184 const char32_t U16[] = UR"??(??)??";
185 const char32_t U17[] = UR"?(?)??)?";
186 const char32_t U18[] = UR"??(??)??)??)??";
188 const wchar_t L00[] = LR"??=??(??<??>??)??'??!??-\
189 (a)#[{}]^|~";
190 )??=??";
191 const wchar_t L01[] = LR"a(
194 )a";
195 const wchar_t L02[] = LR"a(
198 )a";
199 const wchar_t L03[] = LR"ab(
202 )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(??)\
207 abc";)abc";
208 const wchar_t L08[] = LR"def(de)\
209 def";)def";
210 const wchar_t L09[] = LR"a(??)\
212 )a";
213 const wchar_t L10[] = LR"a(??)a\
215 )a";
216 const wchar_t L11[] = LR"ab(??)a\
218 )ab";
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)??/
222 ";)??/";
223 const wchar_t L15[] = LR"??/(??)??/
224 ";)??/";
225 const wchar_t L16[] = LR"??(??)??";
226 const wchar_t L17[] = LR"?(?)??)?";
227 const wchar_t L18[] = LR"??(??)??)??)??";
230 main (void)
232 #define TEST(str, val) \
233 if (sizeof (str) != sizeof (val) \
234 || __builtin_memcmp (str, val, sizeof (str)) != 0) \
235 __builtin_abort ()
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");
240 TEST (s04, "x");
241 TEST (s05, "abc");
242 TEST (s06, "abc");
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\";");
252 TEST (s16, "??");
253 TEST (s17, "?)??");
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");
259 TEST (u804, u8"x");
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\";");
271 TEST (u816, u8"??");
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");
278 TEST (u04, u"x");
279 TEST (u05, u"abc");
280 TEST (u06, u"abc");
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\";");
290 TEST (u16, u"??");
291 TEST (u17, u"?)??");
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");
297 TEST (U04, U"x");
298 TEST (U05, U"abc");
299 TEST (U06, U"abc");
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\";");
309 TEST (U16, U"??");
310 TEST (U17, U"?)??");
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");
316 TEST (L04, L"x");
317 TEST (L05, L"abc");
318 TEST (L06, L"abc");
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\";");
328 TEST (L16, L"??");
329 TEST (L17, L"?)??");
330 TEST (L18, L"??"")??"")??");
331 return 0;