When I compile tests/posix/system.icn with the latest svn checkout on Ubuntu, I get the message:
can't open foo.out for reading
Indeed "x' is compiled and runs properly, but the output ends up in a file named '1' rather than 'foo.out'.
So, redirection seems to be an issue, specifically the ampersand.
When I used 'icont' from Icon version 9.5.1 to translate the program, it worked as expected.
When I replace
system("icont x.icn > foo.out 2>&1")
with
system("icont x.icn > foo.out")
and translate with unicon, the program performed as expected.
tested 9/6 snapshot on ubuntu focal,
no errors
Do you still get the error?