scc

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

0219-abbrev.c (604B)


      1 int
      2 main()
      3 {
      4 	unsigned long c;
      5 	char s[1];
      6 
      7 	*s = 10;
      8 	c = 6;
      9 	*s %= c;
     10 	if (*s != 4)
     11 		return 1;
     12 
     13 	*s = 8;
     14 	c = 2;
     15 	*s <<= c;
     16 	if (*s != 32)
     17 		return 2;
     18 
     19 	*s = 8;
     20 	c = 2;
     21 	*s >>= c;
     22 	if (*s != 2)
     23 		return 3;
     24 
     25 	*s = 12;
     26 	c = 8;
     27 	*s &= c;
     28 	if (*s != 8)
     29 		return 4;
     30 
     31 	*s = 3;
     32 	c = 1;
     33 	*s ^= c;
     34 	if (*s != 2)
     35 		return 5;
     36 
     37 	*s = 1;
     38 	c = 2;
     39 	*s |= c;
     40 	if (*s != 3)
     41 		return 6;
     42 
     43 	*s = 1;
     44 	c = 3;
     45 	*s += c;
     46 	if (*s != 4)
     47 		return 7;
     48 
     49 	*s = 4;
     50 	c = 1;
     51 	*s -= c;
     52 	if (*s != 3)
     53 		return 8;
     54 
     55 	*s = 8;
     56 	c = 2;
     57 	*s /= c;
     58 	if (*s != 4)
     59 		return 9;
     60 
     61 	*s = 4;
     62 	c = 4;
     63 	*s *= c;
     64 	if (*s != 16)
     65 		return 10;
     66 
     67 	return 0;
     68 }