Merged revisions 143552,143554,143557,143560,143562,143564-143567,143570-143573,14357...
[official-gcc.git] / gcc / testsuite / gcc.dg / utf32-1.c
blob7919faa6371374d944b2d024a9ae0316fad6072d
1 /* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
2 /* Test the support for char32_t character constants. */
3 /* { dg-do run } */
4 /* { dg-xfail-run-if "PR36470" { "avr-*-*" "m32c-*-*" } { "*" } { "" } } */
5 /* { dg-options "-std=gnu99 -Wall -Werror" } */
7 typedef __CHAR32_TYPE__ char32_t;
9 extern void abort (void);
11 char32_t c0 = U'a';
12 char32_t c1 = U'\0';
13 char32_t c2 = U'\u0024';
14 char32_t c3 = U'\u2029';
15 char32_t c4 = U'\U00064321';
17 #define A 0x00000061
18 #define D 0x00000024
19 #define X 0x00002029
20 #define Y 0x00064321
22 int main ()
24 if (sizeof (U'a') != sizeof (char32_t))
25 abort ();
26 if (sizeof (U'\0') != sizeof (char32_t))
27 abort ();
28 if (sizeof (U'\u0024') != sizeof (char32_t))
29 abort ();
30 if (sizeof (U'\u2029') != sizeof (char32_t))
31 abort ();
32 if (sizeof (U'\U00064321') != sizeof (char32_t))
33 abort ();
35 if (c0 != A)
36 abort ();
37 if (c1 != 0x0000)
38 abort ();
39 if (c2 != D)
40 abort ();
41 if (c3 != X)
42 abort ();
43 if (c4 != Y)
44 abort ();