1 /* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
2 /* Expected errors for char16_t/char32_t string literals. */
3 /* { dg-do compile { target c++11 } } */
4 // { dg-options "" }
5 
6 const char	s_0[]	= "ab";
7 const char	s_1[]	= u"ab";	/* { dg-error "from wide string" } */
8 const char	s_2[]	= U"ab";	/* { dg-error "from wide string" } */
9 const char	s_3[]	= L"ab";	/* { dg-error "from wide string" } */
10 
11 const char16_t	s16_0[]	= "ab";		/* { dg-error "from non-wide" } */
12 const char16_t	s16_1[]	= u"ab";
13 const char16_t	s16_2[]	= U"ab";	/* { dg-error "from incompatible" } */
14 const char16_t	s16_3[]	= L"ab";	/* { dg-error "from incompatible" } */
15 
16 const char16_t	s16_4[0] = u"ab";	/* { dg-error "chars is too long" } */
17 const char16_t	s16_5[1] = u"ab";	/* { dg-error "chars is too long" } */
18 const char16_t	s16_6[2] = u"ab";	/* { dg-error "chars is too long" } */
19 const char16_t	s16_7[3] = u"ab";
20 const char16_t	s16_8[4] = u"ab";
21 
22 const char32_t	s32_0[]	= "ab";		/* { dg-error "from non-wide" } */
23 const char32_t	s32_1[]	= u"ab";	/* { dg-error "from incompatible" } */
24 const char32_t	s32_2[]	= U"ab";
25 const char32_t	s32_3[]	= L"ab";	/* { dg-error "from incompatible" } */
26 
27 const char32_t	s32_4[0] = U"ab";	/* { dg-error "chars is too long" } */
28 const char32_t	s32_5[1] = U"ab";	/* { dg-error "chars is too long" } */
29 const char32_t	s32_6[2] = U"ab";	/* { dg-error "chars is too long" } */
30 const char32_t	s32_7[3] = U"ab";
31 const char32_t	s32_8[4] = U"ab";
32 
33 const wchar_t	sw_0[]	= "ab";		/* { dg-error "from non-wide" } */
34 const wchar_t	sw_1[]	= u"ab";	/* { dg-error "from incompatible" } */
35 const wchar_t	sw_2[]	= U"ab";	/* { dg-error "from incompatible" } */
36 const wchar_t	sw_3[]	= L"ab";
37