annotate gcc/testsuite/c-c++-common/raw-string-2.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-do run }
kono
parents:
diff changeset
2 // { dg-require-effective-target wchar }
kono
parents:
diff changeset
3 // { dg-options "-std=gnu99 -Wno-c++-compat -trigraphs" { target c } }
kono
parents:
diff changeset
4 // { dg-options "-std=c++0x" { target c++ } }
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 #ifndef __cplusplus
kono
parents:
diff changeset
7 #include <wchar.h>
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 typedef __CHAR16_TYPE__ char16_t;
kono
parents:
diff changeset
10 typedef __CHAR32_TYPE__ char32_t;
kono
parents:
diff changeset
11 #endif
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 #define R
kono
parents:
diff changeset
14 #define u
kono
parents:
diff changeset
15 #define uR
kono
parents:
diff changeset
16 #define U
kono
parents:
diff changeset
17 #define UR
kono
parents:
diff changeset
18 #define u8
kono
parents:
diff changeset
19 #define u8R
kono
parents:
diff changeset
20 #define L
kono
parents:
diff changeset
21 #define LR
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 const char s00[] = R"(a)" "(b)";
kono
parents:
diff changeset
24 const char s01[] = "(a)" R"*(b)*";
kono
parents:
diff changeset
25 const char s02[] = R"(a)" R"(b)";
kono
parents:
diff changeset
26 const char s03[] = R"-(a)-" u8"(b)";
kono
parents:
diff changeset
27 const char s04[] = "(a)" u8R"MNOPQRSTUVWXYZ(b)MNOPQRSTUVWXYZ";
kono
parents:
diff changeset
28 const char s05[] = R"(a)" u8R"wxyzABCDEFGHIJKL(b)wxyzABCDEFGHIJKL";
kono
parents:
diff changeset
29 const char s06[] = u8R";[(a);[" "(b)";
kono
parents:
diff changeset
30 const char s07[] = u8"(a)" R"(b)";
kono
parents:
diff changeset
31 const char s08[] = u8R"(a)" R"_{}#[]<>%:;.?*+-(b)_{}#[]<>%:;.?*+-";
kono
parents:
diff changeset
32 const char s09[] = u8R"/^&|~!=,"'(a)/^&|~!=,"'" u8"(b)";
kono
parents:
diff changeset
33 const char s10[] = u8"(a)" u8R"0123456789abcdef(b)0123456789abcdef";
kono
parents:
diff changeset
34 const char s11[] = u8R"ghijklmnopqrstuv(a)ghijklmnopqrstuv" u8R"w(b)w";
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 const char16_t u03[] = R"-(a)-" u"(b)";
kono
parents:
diff changeset
37 const char16_t u04[] = "(a)" uR"MNOPQRSTUVWXYZ(b)MNOPQRSTUVWXYZ";
kono
parents:
diff changeset
38 const char16_t u05[] = R"(a)" uR"wxyzABCDEFGHIJKL(b)wxyzABCDEFGHIJKL";
kono
parents:
diff changeset
39 const char16_t u06[] = uR";[(a);[" "(b)";
kono
parents:
diff changeset
40 const char16_t u07[] = u"(a)" R"(b)";
kono
parents:
diff changeset
41 const char16_t u08[] = uR"(a)" R"_{}#[]<>%:;.?*+-(b)_{}#[]<>%:;.?*+-";
kono
parents:
diff changeset
42 const char16_t u09[] = uR"/^&|~!=,"'(a)/^&|~!=,"'" u"(b)";
kono
parents:
diff changeset
43 const char16_t u10[] = u"(a)" uR"0123456789abcdef(b)0123456789abcdef";
kono
parents:
diff changeset
44 const char16_t u11[] = uR"ghijklmnopqrstuv(a)ghijklmnopqrstuv" uR"w(b)w";
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 const char32_t U03[] = R"-(a)-" U"(b)";
kono
parents:
diff changeset
47 const char32_t U04[] = "(a)" UR"MNOPQRSTUVWXYZ(b)MNOPQRSTUVWXYZ";
kono
parents:
diff changeset
48 const char32_t U05[] = R"(a)" UR"wxyzABCDEFGHIJKL(b)wxyzABCDEFGHIJKL";
kono
parents:
diff changeset
49 const char32_t U06[] = UR";[(a);[" "(b)";
kono
parents:
diff changeset
50 const char32_t U07[] = U"(a)" R"(b)";
kono
parents:
diff changeset
51 const char32_t U08[] = UR"(a)" R"_{}#[]<>%:;.?*+-(b)_{}#[]<>%:;.?*+-";
kono
parents:
diff changeset
52 const char32_t U09[] = UR"/^&|~!=,"'(a)/^&|~!=,"'" U"(b)";
kono
parents:
diff changeset
53 const char32_t U10[] = U"(a)" UR"0123456789abcdef(b)0123456789abcdef";
kono
parents:
diff changeset
54 const char32_t U11[] = UR"ghijklmnopqrstuv(a)ghijklmnopqrstuv" UR"w(b)w";
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 const wchar_t L03[] = R"-(a)-" L"(b)";
kono
parents:
diff changeset
57 const wchar_t L04[] = "(a)" LR"MNOPQRSTUVWXYZ(b)MNOPQRSTUVWXYZ";
kono
parents:
diff changeset
58 const wchar_t L05[] = R"(a)" LR"wxyzABCDEFGHIJKL(b)wxyzABCDEFGHIJKL";
kono
parents:
diff changeset
59 const wchar_t L06[] = LR";[(a);[" "(b)";
kono
parents:
diff changeset
60 const wchar_t L07[] = L"(a)" R"(b)";
kono
parents:
diff changeset
61 const wchar_t L08[] = LR"(a)" R"_{}#[]<>%:;.?*+-(b)_{}#[]<>%:;.?*+-";
kono
parents:
diff changeset
62 const wchar_t L09[] = LR"/^&|~!=,"'(a)/^&|~!=,"'" L"(b)";
kono
parents:
diff changeset
63 const wchar_t L10[] = L"(a)" LR"0123456789abcdef(b)0123456789abcdef";
kono
parents:
diff changeset
64 const wchar_t L11[] = LR"ghijklmnopqrstuv(a)ghijklmnopqrstuv" LR"w(b)w";
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 int
kono
parents:
diff changeset
67 main (void)
kono
parents:
diff changeset
68 {
kono
parents:
diff changeset
69 #define TEST(str, val) \
kono
parents:
diff changeset
70 if (sizeof (str) != sizeof (val) \
kono
parents:
diff changeset
71 || __builtin_memcmp (str, val, sizeof (str)) != 0) \
kono
parents:
diff changeset
72 __builtin_abort ()
kono
parents:
diff changeset
73 TEST (s00, "a(b)");
kono
parents:
diff changeset
74 TEST (s01, "(a)b");
kono
parents:
diff changeset
75 TEST (s02, "ab");
kono
parents:
diff changeset
76 TEST (s03, "a(b)");
kono
parents:
diff changeset
77 TEST (s04, "(a)b");
kono
parents:
diff changeset
78 TEST (s05, "ab");
kono
parents:
diff changeset
79 TEST (s06, "a(b)");
kono
parents:
diff changeset
80 TEST (s07, "(a)b");
kono
parents:
diff changeset
81 TEST (s08, "ab");
kono
parents:
diff changeset
82 TEST (s09, "a(b)");
kono
parents:
diff changeset
83 TEST (s10, "(a)b");
kono
parents:
diff changeset
84 TEST (s11, "ab");
kono
parents:
diff changeset
85 TEST (u03, u"a(b)");
kono
parents:
diff changeset
86 TEST (u04, u"(a)b");
kono
parents:
diff changeset
87 TEST (u05, u"ab");
kono
parents:
diff changeset
88 TEST (u06, u"a(b)");
kono
parents:
diff changeset
89 TEST (u07, u"(a)b");
kono
parents:
diff changeset
90 TEST (u08, u"ab");
kono
parents:
diff changeset
91 TEST (u09, u"a(b)");
kono
parents:
diff changeset
92 TEST (u10, u"(a)b");
kono
parents:
diff changeset
93 TEST (u11, u"ab");
kono
parents:
diff changeset
94 TEST (U03, U"a(b)");
kono
parents:
diff changeset
95 TEST (U04, U"(a)b");
kono
parents:
diff changeset
96 TEST (U05, U"ab");
kono
parents:
diff changeset
97 TEST (U06, U"a(b)");
kono
parents:
diff changeset
98 TEST (U07, U"(a)b");
kono
parents:
diff changeset
99 TEST (U08, U"ab");
kono
parents:
diff changeset
100 TEST (U09, U"a(b)");
kono
parents:
diff changeset
101 TEST (U10, U"(a)b");
kono
parents:
diff changeset
102 TEST (U11, U"ab");
kono
parents:
diff changeset
103 TEST (L03, L"a(b)");
kono
parents:
diff changeset
104 TEST (L04, L"(a)b");
kono
parents:
diff changeset
105 TEST (L05, L"ab");
kono
parents:
diff changeset
106 TEST (L06, L"a(b)");
kono
parents:
diff changeset
107 TEST (L07, L"(a)b");
kono
parents:
diff changeset
108 TEST (L08, L"ab");
kono
parents:
diff changeset
109 TEST (L09, L"a(b)");
kono
parents:
diff changeset
110 TEST (L10, L"(a)b");
kono
parents:
diff changeset
111 TEST (L11, L"ab");
kono
parents:
diff changeset
112 return 0;
kono
parents:
diff changeset
113 }