2008-05-30 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / g++.dg / ext / utf-cvt.C
blob3ebc3a19af1a8ebcdef4f3e02c1883b9f30126ca
1 /* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
2 /* Test the char16_t and char32_t promotion rules. */
3 /* { dg-do compile } */
4 /* { dg-options "-std=c++0x -Wall -Wconversion -Wsign-conversion -Wsign-promo" } */
6 extern void f_c (char);
7 extern void fsc (signed char);
8 extern void fuc (unsigned char);
9 extern void f_s (short);
10 extern void fss (signed short);
11 extern void fus (unsigned short);
12 extern void f_i (int);
13 extern void fsi (signed int);
14 extern void fui (unsigned int);
15 extern void f_l (long);
16 extern void fsl (signed long);
17 extern void ful (unsigned long);
18 extern void f_ll (long long);
19 extern void fsll (signed long long);
20 extern void full (unsigned long long);
22 void m(char16_t c0, char32_t c1)
24     f_c (c0);   /* { dg-warning "alter its value" } */
25     fsc (c0);   /* { dg-warning "alter its value" } */
26     fuc (c0);   /* { dg-warning "alter its value" } */
27     f_s (c0);   /* { dg-warning "change the sign" } */
28     fss (c0);   /* { dg-warning "change the sign" } */
29     fus (c0);
30     f_i (c0);
31     fsi (c0);
32     fui (c0);
33     f_l (c0);
34     fsl (c0);
35     ful (c0);
36     f_ll (c0);
37     fsll (c0);
38     full (c0);
40     f_c (c1);   /* { dg-warning "alter its value" } */
41     fsc (c1);   /* { dg-warning "alter its value" } */
42     fuc (c1);   /* { dg-warning "alter its value" } */
43     f_s (c1);   /* { dg-warning "alter its value" } */
44     fss (c1);   /* { dg-warning "alter its value" } */
45     fus (c1);   /* { dg-warning "alter its value" } */
46     f_i (c1);   /* { dg-warning "change the sign" } */
47     fsi (c1);   /* { dg-warning "change the sign" } */
48     fui (c1);
49     f_l (c1);   /* { dg-warning "change the sign" "" { target { ilp32 } } } */
50     fsl (c1);   /* { dg-warning "change the sign" "" { target { ilp32 } } } */
51     ful (c1);
52     f_ll (c1);
53     fsll (c1);
54     full (c1);