Depending on what you want to do, either writeln("sqrt(-1)"); or writeln(sqrt(1)); works.
I'm sorry, I haven't made it clear the first time. So: With CRT, all writeln do nothing. For example: uses crt; begin writeln('OK') end. produces nothing. uses crt; begin writeln('OK'); writeln(sqrt(-1)) end. produces just the error message from sqrt(-1), NOT 'OK'. Same programs without "uses crt;" both include 'OK' (the latter before the error message).
You might try:
program testcrt; uses gpc, crt; begin writeln('OK'); sleep(10); writeln(sqrt(-1)); end.
Now I understand more about the problem. If I put the CRT unit in, each write will actually be to some virtual screen appearing on top of my console and disappearing after program finished. As all test programs above finish quickly, I simply can't see it. Therefore, this sample:
program testcrt; uses gpc, crt; begin writeln('OK'); readln end.
works as expected, but there is nothing left on the console after it ran. Is this by design? Because I might have programs which use CRT for every kind of things and I still must see their output.