OSDN Git Service

Improve vectorization cost model diagnostic.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / c-c++-common / raw-string-1.c
1 // { dg-do run }
2 // { dg-require-effective-target wchar }
3 // { dg-options "-std=gnu99 -Wno-c++-compat" { target c } }
4 // { dg-options "-std=c++0x" { target c++ } }
5
6 #ifndef __cplusplus
7 #include <wchar.h>
8
9 typedef __CHAR16_TYPE__ char16_t;
10 typedef __CHAR32_TYPE__ char32_t;
11 #endif
12
13 const char s0[] = R"(a\
14 \u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
15 c)";
16 const char s1[] = "a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
17 const char s2[] = R"*|*(a\
18 b
19 c)"
20 c)*|"
21 c)*|*";
22 const char s3[] = "ab\nc)\"\nc)*|\"\nc";
23
24 const char t0[] = u8R"(a\
25 \u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
26 c)";
27 const char t1[] = u8"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
28 const char t2[] = u8R"*|*(a\
29 b
30 c)"
31 c)*|"
32 c)*|*";
33 const char t3[] = u8"ab\nc)\"\nc)*|\"\nc";
34
35 const char16_t u0[] = uR"(a\
36 \u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
37 c)";
38 const char16_t u1[] = u"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
39 const char16_t u2[] = uR"*|*(a\
40 b
41 c)"
42 c)*|"
43 c)*|*";
44 const char16_t u3[] = u"ab\nc)\"\nc)*|\"\nc";
45
46 const char32_t U0[] = UR"(a\
47 \u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
48 c)";
49 const char32_t U1[] = U"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
50 const char32_t U2[] = UR"*|*(a\
51 b
52 c)"
53 c)*|"
54 c)*|*";
55 const char32_t U3[] = U"ab\nc)\"\nc)*|\"\nc";
56
57 const wchar_t L0[] = LR"(a\
58 \u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
59 c)";
60 const wchar_t L1[] = L"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
61 const wchar_t L2[] = LR"*|*(a\
62 b
63 c)"
64 c)*|"
65 c)*|*";
66 const wchar_t L3[] = L"ab\nc)\"\nc)*|\"\nc";
67
68 int
69 main (void)
70 {
71   if (sizeof (s0) != sizeof (s1)
72       || __builtin_memcmp (s0, s1, sizeof (s0)) != 0)
73     __builtin_abort ();
74   if (sizeof (s2) != sizeof (s3)
75       || __builtin_memcmp (s2, s3, sizeof (s2)) != 0)
76     __builtin_abort ();
77   if (sizeof (t0) != sizeof (t1)
78       || __builtin_memcmp (t0, t1, sizeof (t0)) != 0)
79     __builtin_abort ();
80   if (sizeof (t2) != sizeof (t3)
81       || __builtin_memcmp (t2, t3, sizeof (t2)) != 0)
82     __builtin_abort ();
83   if (sizeof (u0) != sizeof (u1)
84       || __builtin_memcmp (u0, u1, sizeof (u0)) != 0)
85     __builtin_abort ();
86   if (sizeof (u2) != sizeof (u3)
87       || __builtin_memcmp (u2, u3, sizeof (u2)) != 0)
88     __builtin_abort ();
89   if (sizeof (U0) != sizeof (U1)
90       || __builtin_memcmp (U0, U1, sizeof (U0)) != 0)
91     __builtin_abort ();
92   if (sizeof (U2) != sizeof (U3)
93       || __builtin_memcmp (U2, U3, sizeof (U2)) != 0)
94     __builtin_abort ();
95   if (sizeof (L0) != sizeof (L1)
96       || __builtin_memcmp (L0, L1, sizeof (L0)) != 0)
97     __builtin_abort ();
98   if (sizeof (L2) != sizeof (L3)
99       || __builtin_memcmp (L2, L3, sizeof (L2)) != 0)
100     __builtin_abort ();
101   if (sizeof (R"*()*") != 1
102       || __builtin_memcmp (R"*()*", "", 1) != 0)
103     __builtin_abort ();
104   return 0;
105 }