aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/CommandLineTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
-rw-r--r--llvm/unittests/Support/CommandLineTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp
index 7fe1cf4..e68761e 100644
--- a/llvm/unittests/Support/CommandLineTest.cpp
+++ b/llvm/unittests/Support/CommandLineTest.cpp
@@ -420,6 +420,14 @@ TEST(CommandLineTest, HideUnrelatedOptionsMulti) {
<< "Hid default option that should be visable.";
}
+TEST(CommandLineTest, SetMultiValues) {
+ StackOption<int> Option("option");
+ const char *args[] = {"prog", "-option=1", "-option=2"};
+ EXPECT_TRUE(cl::ParseCommandLineOptions(array_lengthof(args), args,
+ StringRef(), &llvm::nulls()));
+ EXPECT_EQ(Option, 2);
+}
+
TEST(CommandLineTest, SetValueInSubcategories) {
cl::ResetCommandLineParser();