scc

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

0134-arith.c (827B)


      1 int
      2 main()
      3 {
      4         int x;
      5 
      6         x = 0;
      7         if ((x = x + 2) != 2)        // 2
      8 		return 1;
      9         if ((x = x - 1) != 1)        // 1
     10 		return 2;
     11         if ((x = x * 6) != 6)        // 6
     12 		return 3;
     13         if ((x = x / 2) != 3)        // 3
     14 		return 4;
     15         if ((x = x % 2) != 1)        // 1
     16 		return 5;
     17         if ((x = x << 2) != 4)       // 4
     18 		return 6;
     19         if ((x = x >> 1) != 2)       // 2
     20 		return 7;
     21         if ((x = x | 255) != 255)    // 255
     22 		return 8;
     23         if ((x = x & 3) != 3)        // 3
     24 		return 9;
     25         if ((x = x ^ 1) != 2)        // 2
     26 		return 10;
     27         if ((x = x + (x > 1)) != 3)  // 3
     28 		return 11;
     29         if ((x = x + (x < 3)) != 3)  // 3
     30 		return 12;
     31         if ((x = x + (x > 1)) != 4)  // 4
     32 		return 13;
     33         if ((x = x + (x < 4)) != 4)  // 4
     34 		return 14;
     35         return 0;
     36 }