1 /* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
2 /* Test the char8_t promotion rules. */
3 /* { dg-do compile { target c++11 } } */
4 /* { dg-options "-fchar8_t -fsigned-char -Wall -Wconversion -Wsign-conversion -Wsign-promo" } */
5
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);
21
m(char8_t c)22 void m(char8_t c)
23 {
24 f_c (c); /* { dg-warning "change the sign" } */
25 fsc (c); /* { dg-warning "change the sign" } */
26 fuc (c);
27 f_s (c);
28 fss (c);
29 fus (c);
30 f_i (c);
31 fsi (c);
32 fui (c);
33 f_l (c);
34 fsl (c);
35 ful (c);
36 f_ll (c);
37 fsll (c);
38 full (c);
39 }
40