%BEGIN
%owninteger Fail=0
%STRING(30)S,T,U
%ROUTINESPEC CHECK(%STRING(30) P,Q,R)
      S=""; T=S
      PRINTSTRING("BUG0") %UNLESS T=""
      CHECK(S,T,"")
      S="ABCD"; T=S
      CHECK(S,T,"ABCD")
      %UNLESS "MAST"<="MEST"<="MOST" %THEN Fail=1 %and PRINTSTRING("BUG1")
      S="MAST"; T="MEST"; U="MOST"
      %UNLESS S<=T<=U %THEN Fail=1 %and PRINTSTRING("BUG2")
      %if Fail=0 %then printstring("TEST OK")
      %ROUTINE CHECK(%STRING(30) P,Q,R)
      Fail=1 %and PRINTSTRING("CHECK FAILS") %UNLESS %C
         P=S %AND Q=R %AND P=Q=R
      %END
%ENDOFPROGRAM
