
%BEGIN
!***********************************************************************
!*    TESTS SOME VERY NOTTED CONDITIONS FOR CONSISTENCY. NO OPUT IF OK *
!***********************************************************************
%INTEGER I,J,K
%ROUTINESPEC A
%ROUTINESPEC B
%ROUTINESPEC C
      K=0
      %CYCLE I=-1,1,1
         %CYCLE J=0,1,3
            %IFNOTNOTNOTNOT I=1 %THEN A %ELSE B
            %IFNOT (%NOT I=1) %THEN A %ELSE B
            %IF I=1 %THEN A %ELSE B
            C
            %IFNOT I=1 %THEN A %ELSE B
            %UNLESS I=1 %THEN A %ELSE B
            C
            %IF I=1 %AND J#2 %THEN A %ELSE B
            %IF I=1 %ANDNOT J=2 %THEN A %ELSE B
            C
            %IF I=1 %OR 1<=J<=2 %THEN A %ELSE B
            %IF I=1 %OR (1<=J %AND J<=2) %THEN A %ELSE B
            C
            %IF I=0=J %THEN A %ELSE B
            %IF I=0 %AND J=0 %THEN A %ELSE B
            C
         %REPEAT
      %REPEAT
      PRINTSTRING("PART 1 OK ")
      %CYCLE I=-1,1,1
         %CYCLE J=0,1,3
            %IF I=1 %ANDNOT J#1 %THEN A %ELSE B
            %IF I=1 %ANDNOT (J#1) %THEN A %ELSE B
            C
            %IF I=1 %ORNOT 1<=J<=2 %THEN A %ELSE B
            %IF I=1 %ORNOT (1<=J %AND J<=2) %THEN A %ELSE B
            C
            %IF I=1 %AND J=2 %THEN A %ELSE B
            %IFNOT (%NOT (I=1 %AND J=2)) %THEN A %ELSE B
            C
         %REPEAT
      %REPEAT
      PRINTSTRING("TEST OK")
%ROUTINE A; K=K<<8!'A'; %END
%ROUTINE B; K=K<<8!'B'; %END
%ROUTINE C
      %IF K=M'AA' %OR K=M'BB' %OR K=M'AAA' %OR K=M'BBB' %THEN K=0 %ANDRETURN
      WRITE(I,1); WRITE(J,1); WRITE(K,1)
      %MONITOR
      %STOP
%END
%ENDOFPROGRAM
