[llvm-rc] Support joined or separate spelling for /fo flag
CMake invokes rc using the joined spelling which appears to be supported
by Microsoft's rc implementation, so we should support it as well.
Differential Revision: https://reviews.llvm.org/D54191
llvm-svn: 346470
diff --git a/llvm/test/tools/llvm-rc/Inputs/empty.rc b/llvm/test/tools/llvm-rc/Inputs/empty.rc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/llvm/test/tools/llvm-rc/Inputs/empty.rc
diff --git a/llvm/test/tools/llvm-rc/flags.test b/llvm/test/tools/llvm-rc/flags.test
new file mode 100644
index 0000000..452e90a
--- /dev/null
+++ b/llvm/test/tools/llvm-rc/flags.test
@@ -0,0 +1,4 @@
+; RUN: llvm-rc /dry-run /FO %t %p/Inputs/empty.rc 2>&1 | FileCheck %s --allow-empty --check-prefix=FO
+; RUN: llvm-rc /dry-run /FO%t %p/Inputs/empty.rc 2>&1 | FileCheck %s --allow-empty --check-prefix=FO
+
+; FO-NOT: Exactly one input file should be provided.
diff --git a/llvm/tools/llvm-rc/Opts.td b/llvm/tools/llvm-rc/Opts.td
index 11f40f5..3ff5ac2 100644
--- a/llvm/tools/llvm-rc/Opts.td
+++ b/llvm/tools/llvm-rc/Opts.td
@@ -4,7 +4,7 @@
// These options seem to be important for the tool
// and should be implemented.
-def FILEOUT : Separate<[ "/", "-" ], "FO">,
+def FILEOUT : JoinedOrSeparate<[ "/", "-" ], "FO">,
HelpText<"Change the output file location.">;
def DEFINE : Separate<[ "/", "-" ], "D">,