scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

0142-char-const.c (429B)


      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 != 35)
     13 		return 2;
     14 
     15 	uc = 1u;
     16 	if (uc != (1025 & 0xFF))
     17 		return 1;
     18 
     19 	uc = 'A';
     20 	if (uc != 0x41)
     21 		return 3;
     22 
     23 	sc = -1;
     24 	if ((sc & 0xFF) != 0xFF)
     25 		return 4;
     26 
     27 	sc = '\x23';
     28 	if (sc != 35)
     29 		return 5;
     30 
     31 	sc = 1u;
     32 	if (sc != (1025 & 0xFF))
     33 		return 6;
     34 
     35 	sc = 'A';
     36 	if (sc != 0x41)
     37 		return 7;
     38 
     39 	return 0;
     40 }