From e2f6896eef8dcd1d09cf3342aa41b884b7ce9a43 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Fri, 9 Nov 2018 03:16:53 +0000 Subject: [PATCH] [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 --- llvm/test/tools/llvm-rc/Inputs/empty.rc | 0 llvm/test/tools/llvm-rc/flags.test | 4 ++++ llvm/tools/llvm-rc/Opts.td | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 llvm/test/tools/llvm-rc/Inputs/empty.rc create mode 100644 llvm/test/tools/llvm-rc/flags.test 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 000000000000..e69de29bb2d1 diff --git a/llvm/test/tools/llvm-rc/flags.test b/llvm/test/tools/llvm-rc/flags.test new file mode 100644 index 000000000000..452e90a406bb --- /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 11f40f571037..3ff5ac2d4980 100644 --- a/llvm/tools/llvm-rc/Opts.td +++ b/llvm/tools/llvm-rc/Opts.td @@ -4,7 +4,7 @@ include "llvm/Option/OptParser.td" // 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">,