OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [utf16-1.c] - Blame information for rev 749

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
2
/* Test the support for char16_t character constants. */
3
/* { dg-do run } */
4
/* { dg-options "-std=gnu99 -Wall -Werror" } */
5
 
6
typedef __CHAR16_TYPE__ char16_t;
7
 
8
extern void abort (void);
9
 
10
char16_t        c0 = u'a';
11
char16_t        c1 = u'\0';
12
char16_t        c2 = u'\u0024';
13
char16_t        c3 = u'\u2029';
14
char16_t        c4 = u'\u8010';
15
 
16
char16_t        c5 = 'a';
17
char16_t        c6 = U'a';
18
char16_t        c7 = U'\u2029';
19
char16_t        c8 = U'\u8010';
20
char16_t        c9 = L'a';
21
char16_t        ca = L'\u2029';
22
char16_t        cb = L'\u8010';
23
 
24
#define A       0x0061
25
#define D       0x0024
26
#define X       0x2029
27
#define Y       0x8010
28
 
29
int main ()
30
{
31
    if (sizeof (u'a') != sizeof (char16_t))
32
        abort ();
33
    if (sizeof (u'\0') != sizeof (char16_t))
34
        abort ();
35
    if (sizeof (u'\u0024') != sizeof (char16_t))
36
        abort ();
37
    if (sizeof (u'\u2029') != sizeof (char16_t))
38
        abort ();
39
    if (sizeof (u'\u8010') != sizeof (char16_t))
40
        abort ();
41
 
42
    if (c0 != A)
43
        abort ();
44
    if (c1 != 0x0000)
45
        abort ();
46
    if (c2 != D)
47
        abort ();
48
    if (c3 != X)
49
        abort ();
50
    if (c4 != Y)
51
        abort ();
52
 
53
    if (c5 != A)
54
        abort ();
55
    if (c6 != A)
56
        abort ();
57
    if (c7 != X)
58
        abort ();
59
    if (c8 != Y)
60
        abort ();
61
    if (c9 != A)
62
        abort ();
63
    if (ca != X)
64
        abort ();
65
    if (cb != Y)
66
        abort ();
67
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.