scc

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

0032-indec.c (396B)


      1 int
      2 zero()
      3 {
      4 	return 0;
      5 }
      6 
      7 int
      8 one()
      9 {
     10 	return 1;
     11 }
     12 
     13 int
     14 main()
     15 {
     16 	int x;
     17 	int y;
     18 	
     19 	x = zero();
     20 	y = ++x;
     21 	if (x != 1)
     22 		return 1;
     23 	if (y != 1)
     24 		return 1;
     25 	
     26 	x = one();	
     27 	y = --x;
     28 	if (x != 0)
     29 		return 1;
     30 	if (y != 0)
     31 		return 1;
     32 	
     33 	x = zero();
     34 	y = x++;
     35 	if (x != 1)
     36 		return 1;
     37 	if (y != 0)
     38 		return 1;
     39 	
     40 	x = one();
     41 	y = x--;
     42 	if (x != 0)
     43 		return 1;
     44 	if (y != 1)
     45 		return 1;
     46 	
     47 	return 0;
     48 }