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 { target c++11 } } */
4 /* { dg-options "-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 "conversion from .char16_t. to .char. may change value" } */
25 fsc (c0); /* { dg-warning "change value" } */
26 fuc (c0); /* { dg-warning "change value" } */
27 f_s (c0); /* { dg-warning "change the sign" } */
28 fss (c0); /* { dg-warning "change the sign" } */
40 f_c (c1); /* { dg-warning "change value" } */
41 fsc (c1); /* { dg-warning "change value" } */
42 fuc (c1); /* { dg-warning "change value" } */
43 f_s (c1); /* { dg-warning "change value" } */
44 fss (c1); /* { dg-warning "change value" } */
45 fus (c1); /* { dg-warning "change value" } */
46 f_i (c1); /* { dg-warning "change the sign" } */
47 fsi (c1); /* { dg-warning "change the sign" } */
49 f_l (c1); /* { dg-warning "change the sign" "" { target { llp64 || ilp32 } } } */
50 fsl (c1); /* { dg-warning "change the sign" "" { target { llp64 || ilp32 } } } */