OSDN Git Service

PR middle-end/38934
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / utf32-2.c
1 /* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
2 /* Test the support for char32_t* string constants. */
3 /* { dg-do run } */
4 /* { dg-xfail-run-if "PR36470" { "avr-*-*" } { "*" } { "" } } */
5 /* { dg-options "-std=gnu99 -Wall -Werror" } */
6
7 typedef __CHAR32_TYPE__ char32_t;
8
9 extern void abort (void);
10
11 char32_t        *s0 = U"ab";
12 char32_t        *s1 = U"a\u0024";
13 char32_t        *s2 = U"a\u2029";
14 char32_t        *s3 = U"a\U00064321";
15
16 #define A       0x00000061
17 #define B       0x00000062
18 #define D       0x00000024
19 #define X       0x00002029
20 #define Y       0x00064321
21
22 int main ()
23 {
24     if (s0[0] != A || s0[1] != B || s0[2] != 0x00000000)
25         abort ();
26     if (s1[0] != A || s1[1] != D || s0[2] != 0x00000000)
27         abort ();
28     if (s2[0] != A || s2[1] != X || s0[2] != 0x00000000)
29         abort ();
30     if (s3[0] != A || s3[1] != Y || s3[2] != 0x00000000)
31         abort ();
32 }