The flang script reads from standard input if a source file is not provided on the command line. It appears to hang, but it’s really just waiting for input.
Flang isn’t hooked up to a code generator yet, so instead, by default, flang generates another Fortran source file and tries to compile that file with a different compiler. The default is pgf90, but you can set the environment variable F18_FC to be a different compiler, like gfortran.
The flang script that you are running is just a throwaway driver until the real driver is ready. That work is under development right now, but I don’t know when it will be ready. Until then, we have this quirky script that lets us test flang semantics.