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=gnu99 -Wall -Wconversion -Wsign-conversion" } */
6 typedef short unsigned int char16_t
;
7 typedef unsigned int char32_t
;
9 extern void f_c (char);
10 extern void fsc (signed char);
11 extern void fuc (unsigned char);
12 extern void f_s (short);
13 extern void fss (signed short);
14 extern void fus (unsigned short);
15 extern void f_i (int);
16 extern void fsi (signed int);
17 extern void fui (unsigned int);
18 extern void f_l (long);
19 extern void fsl (signed long);
20 extern void ful (unsigned long);
21 extern void f_ll (long long);
22 extern void fsll (signed long long);
23 extern void full (unsigned long long);
25 void m (char16_t c0
, char32_t c1
)
27 f_c (c0
); /* { dg-warning "alter its value" } */
28 fsc (c0
); /* { dg-warning "alter its value" } */
29 fuc (c0
); /* { dg-warning "alter its value" } */
30 f_s (c0
); /* { dg-warning "change the sign" } */
31 fss (c0
); /* { dg-warning "change the sign" } */
43 f_c (c1
); /* { dg-warning "alter its value" } */
44 fsc (c1
); /* { dg-warning "alter its value" } */
45 fuc (c1
); /* { dg-warning "alter its value" } */
46 f_s (c1
); /* { dg-warning "alter its value" } */
47 fss (c1
); /* { dg-warning "alter its value" } */
48 fus (c1
); /* { dg-warning "alter its value" } */
49 f_i (c1
); /* { dg-warning "change the sign" } */
50 fsi (c1
); /* { dg-warning "change the sign" } */
52 f_l (c1
); /* { dg-warning "change the sign" "" { target { ilp32 } } } */
53 fsl (c1
); /* { dg-warning "change the sign" "" { target { ilp32 } } } */