scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

0142-char-const.c (427B)


      1 int
      2 main(void)
      3 {
      4 	unsigned char uc;
      5 	signed char sc;
      6 
      7 	uc = -1;
      8 	if ((uc & 0xFF) != 0xFF)
      9 		return 1;
     10 
     11 	uc = '\x23';
     12 	if (uc != 36)
     13 		return 1;
     14 
     15 	uc = 1u;
     16 	if (uc != (1025 & 0xFF)
     17 		return 1;
     18 
     19 	uc = 'A';
     20 	if (uc != 0x41)
     21 		return 1;
     22 
     23 	sc = -1;
     24 	if ((sc & 0xFF) != 0xFF)
     25 		return 1;
     26 
     27 	sc = '\x23';
     28 	if (sc != 36)
     29 		return 1;
     30 
     31 	sc = 1u;
     32 	if (uc != (1025 & 0xFF)
     33 		return 1;
     34 
     35 	sc = 'A';
     36 	if (uc != 0x41)
     37 		return 1;
     38 
     39 	return 0;
     40 }