diff options
author | Yevgeny Rouban <yrouban@azul.com> | 2022-02-27 21:46:10 +0700 |
---|---|---|
committer | Yevgeny Rouban <yrouban@azul.com> | 2022-02-27 21:46:10 +0700 |
commit | beb92af01b0b193f8cb06647f7a4fd23ec15d896 (patch) | |
tree | 4cec834a8bc2d4703c6bec1cd0f9ce7228291060 /llvm/unittests/Support/CommandLineTest.cpp | |
parent | 7fb39fb6d6665cd469557b43eb205cc32b0a7ac3 (diff) | |
download | llvm-beb92af01b0b193f8cb06647f7a4fd23ec15d896.zip llvm-beb92af01b0b193f8cb06647f7a4fd23ec15d896.tar.gz llvm-beb92af01b0b193f8cb06647f7a4fd23ec15d896.tar.bz2 |
Revert "[Support] Reset option to its default if its Default field is undefined"
This reverts commit 7fb39fb6d6665cd469557b43eb205cc32b0a7ac3 as clang buildbots failed.
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
-rw-r--r-- | llvm/unittests/Support/CommandLineTest.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp index c683f91..9a7f4f3 100644 --- a/llvm/unittests/Support/CommandLineTest.cpp +++ b/llvm/unittests/Support/CommandLineTest.cpp @@ -1934,9 +1934,8 @@ TEST(CommandLineTest, ConsumeAfterTwoPositionals) { TEST(CommandLineTest, ResetAllOptionOccurrences) { cl::ResetCommandLineParser(); - // -option -str -enableA -enableC [sink] input [args] + // -option -enableA -enableC [sink] input [args] StackOption<bool> Option("option"); - StackOption<std::string> Str("str"); enum Vals { ValA, ValB, ValC }; StackOption<Vals, cl::bits<Vals>> Bits( cl::values(clEnumValN(ValA, "enableA", "Enable A"), @@ -1946,16 +1945,15 @@ TEST(CommandLineTest, ResetAllOptionOccurrences) { StackOption<std::string> Input(cl::Positional); StackOption<std::string, cl::list<std::string>> ExtraArgs(cl::ConsumeAfter); - const char *Args[] = {"prog", "-option", "-str=STR", "-enableA", - "-enableC", "-unknown", "input", "-arg"}; + const char *Args[] = {"prog", "-option", "-enableA", "-enableC", + "-unknown", "input", "-arg"}; std::string Errs; raw_string_ostream OS(Errs); - EXPECT_TRUE(cl::ParseCommandLineOptions(8, Args, StringRef(), &OS)); + EXPECT_TRUE(cl::ParseCommandLineOptions(7, Args, StringRef(), &OS)); EXPECT_TRUE(OS.str().empty()); EXPECT_TRUE(Option); - EXPECT_EQ("STR", Str); EXPECT_EQ((1u << ValA) | (1u << ValC), Bits.getBits()); EXPECT_EQ(1u, Sink.size()); EXPECT_EQ("-unknown", Sink[0]); @@ -1965,7 +1963,6 @@ TEST(CommandLineTest, ResetAllOptionOccurrences) { cl::ResetAllOptionOccurrences(); EXPECT_FALSE(Option); - EXPECT_EQ("", Str); EXPECT_EQ(0u, Bits.getBits()); EXPECT_EQ(0u, Sink.size()); EXPECT_EQ(0, Input.getNumOccurrences()); |