scc

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

0034-logandor.c (485B)


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