$ flang-new -o /tmp/testir.ll /tmp/test.f90 -Xflang -emit-llvm -S
error: Only one action option is allowed
I think this happens because flang-new decides to emit an object, then the argument to fc1 adds an action to emit llvm as well. With clang this results in emitting llvm IR but flang is stricter.
Which is fine, but it would be nice to know what actions have been added or are going to be added, so we can work backwards to find the command line option that causes it. Roughly:
$ flang-new -o /tmp/testir.ll /tmp/test.f90 -Xflang -emit-llvm -S
error: Only one action option is allowed. Have "-emit-obj", tried to add "-emit-llvm".
And for the record, the way we should be using this option is:
$ flang-new -o /tmp/testir.ll /tmp/test.f90 -emit-llvm -S
Which is equivalent.
(Compiler Explorer is using the -Xclang -emit-llvm style, that's how I found ended up finding this)