RISC-V: Add deprecation warning to LP64E abi
[official-gcc.git] / gcc / testsuite / gcc.dg / utf-array.c
blob7f0cb915e041a3a42629f960871bcb3d140ed6c4
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 } */
4 /* { dg-require-effective-target wchar } */
5 /* { dg-options "-std=gnu99" } */
7 #include <wchar.h>
9 typedef __CHAR16_TYPE__ char16_t;
10 typedef __CHAR32_TYPE__ char32_t;
12 const char s_0[] = "ab";
13 const char s_1[] = u"ab"; /* { dg-error "from a string literal with type array of" } */
14 const char s_2[] = U"ab"; /* { dg-error "from a string literal with type array of" } */
15 const char s_3[] = L"ab"; /* { dg-error "from a string literal with type array of .(long |short )?(unsigned )?int." } */
16 const char s_4[] = u8"ab";
18 const char16_t s16_0[] = "ab"; /* { dg-error "from a string literal with type array of .char." } */
19 const char16_t s16_1[] = u"ab";
20 const char16_t s16_2[] = U"ab"; /* { dg-error "from a string literal with type array of" } */
21 const char16_t s16_3[] = L"ab"; /* { dg-error "from a string literal with type array of .(long |short )?(unsigned )?int." "" { target { ! wchar_t_char16_t_compatible } } } */
22 const char16_t s16_4[] = u8"ab"; /* { dg-error "from a string literal with type array of .char." } */
24 const char16_t s16_5[0] = u"ab"; /* { dg-warning " is too long" } */
25 const char16_t s16_6[1] = u"ab"; /* { dg-warning " is too long" } */
26 const char16_t s16_7[2] = u"ab";
27 const char16_t s16_8[3] = u"ab";
28 const char16_t s16_9[4] = u"ab";
30 const char32_t s32_0[] = "ab"; /* { dg-error "from a string literal with type array of .char." } */
31 const char32_t s32_1[] = u"ab"; /* { dg-error "from a string literal with type array of" } */
32 const char32_t s32_2[] = U"ab";
33 const char32_t s32_3[] = L"ab"; /* { dg-error "from a string literal with type array of .(long |short )?(unsigned )?int." "" { target { ! wchar_t_char32_t_compatible } } } */
34 const char32_t s32_4[] = u8"ab"; /* { dg-error "from a string literal with type array of .char." } */
36 const char32_t s32_5[0] = U"ab"; /* { dg-warning " is too long" } */
37 const char32_t s32_6[1] = U"ab"; /* { dg-warning " is too long" } */
38 const char32_t s32_7[2] = U"ab"; /* { dg-warning " is too long" "" { target "m32c-*-*" } } */
39 const char32_t s32_8[3] = U"ab"; /* { dg-warning " is too long" "" { target "m32c-*-*" } } */
40 const char32_t s32_9[4] = U"ab"; /* { dg-warning " is too long" "" { target "m32c-*-*" } } */
42 const wchar_t sw_0[] = "ab"; /* { dg-error "from a string literal with type array of .char." } */
43 const wchar_t sw_1[] = u"ab"; /* { dg-error "from a string literal with type array of" "" { target { ! wchar_t_char16_t_compatible } } } */
44 const wchar_t sw_2[] = U"ab"; /* { dg-error "from a string literal with type array of" "" { target { ! wchar_t_char32_t_compatible } } } */
45 const wchar_t sw_3[] = L"ab";
46 const wchar_t sw_4[] = u8"ab"; /* { dg-error "from a string literal with type array of .char." } */