Lines Matching refs:cl

67 template <typename T, typename Base = cl::opt<T>>
81 class StackSubCommand : public cl::SubCommand {
93 cl::OptionCategory TestCategory("Test Options", "Description");
95 StackOption<int> TestOption("test-option", cl::desc("old description")); in TEST()
101 StringMap<cl::Option *> &Map = in TEST()
102 cl::getRegisteredOptions(*cl::TopLevelSubCommand); in TEST()
106 cl::Option *Retrieved = Map["test-option"]; in TEST()
111 [&](const llvm::cl::OptionCategory *Cat) { in TEST()
112 return Cat == &cl::getGeneralCategory(); in TEST()
119 [&](const llvm::cl::OptionCategory *Cat) { in TEST()
136 Retrieved->setHiddenFlag(cl::Hidden); in TEST()
137 ASSERT_EQ(cl::Hidden, TestOption.getOptionHiddenFlag()) << in TEST()
142 StackOption<int> TestOption2("test-option", cl::cat(TestCategory)); in TEST()
146 [&](const llvm::cl::OptionCategory *Cat) { in TEST()
153 StackOption<int> TestOption2("test-option2", cl::cat(TestCategory), in TEST()
154 cl::cat(cl::getGeneralCategory()), in TEST()
155 cl::cat(cl::getGeneralCategory())); in TEST()
162 [&](const llvm::cl::OptionCategory *Cat) { in TEST()
168 [&](const llvm::cl::OptionCategory *Cat) { in TEST()
169 return Cat == &cl::getGeneralCategory(); in TEST()
173 cl::OptionCategory AnotherCategory("Additional test Options", "Description"); in TEST()
174 StackOption<int> TestOption("test-option", cl::cat(TestCategory), in TEST()
175 cl::cat(AnotherCategory)); in TEST()
178 [&](const llvm::cl::OptionCategory *Cat) { in TEST()
179 return Cat == &cl::getGeneralCategory(); in TEST()
184 [&](const llvm::cl::OptionCategory *Cat) { in TEST()
190 [&](const llvm::cl::OptionCategory *Cat) { in TEST()
222 testCommandLineTokenizer(cl::TokenizeGNUCommandLine, Input, Output); in TEST()
230 testCommandLineTokenizer(cl::TokenizeWindowsCommandLine, Input, Output);
236 testCommandLineTokenizer(cl::TokenizeWindowsCommandLine, Input, Output); in TEST()
243 testCommandLineTokenizer(cl::TokenizeWindowsCommandLine, Input0, Output0); in TEST()
248 testCommandLineTokenizer(cl::TokenizeWindowsCommandLine, Input1, Output1); in TEST()
257 testCommandLineTokenizer(cl::TokenizeWindowsCommandLine, Input3, Output3); in TEST()
265 testCommandLineTokenizer(cl::TokenizeWindowsCommandLineFull, Input1, Output1); in TEST()
270 testCommandLineTokenizer(cl::TokenizeWindowsCommandLineFull, Input2, Output2, in TEST()
275 testCommandLineTokenizer(cl::TokenizeWindowsCommandLineFull, Input3, Output3); in TEST()
293 testCommandLineTokenizer(cl::TokenizeWindowsCommandLine, Input, Output, in TEST()
295 testCommandLineTokenizer(cl::TokenizeGNUCommandLine, Input, Output, in TEST()
302 testCommandLineTokenizer(cl::tokenizeConfigFile, Input, Output); in TEST()
308 testCommandLineTokenizer(cl::tokenizeConfigFile, Input, Output); in TEST()
314 testCommandLineTokenizer(cl::tokenizeConfigFile, Input, Output); in TEST()
320 testCommandLineTokenizer(cl::tokenizeConfigFile, Input, Output); in TEST()
326 testCommandLineTokenizer(cl::tokenizeConfigFile, Input, Output); in TEST()
332 testCommandLineTokenizer(cl::tokenizeConfigFile, Input, Output); in TEST()
338 testCommandLineTokenizer(cl::tokenizeConfigFile, Input, Output); in TEST()
345 cl::tokenizeConfigFile("\\\n", Saver, Actual, /*MarkEOLs=*/false); in TEST()
353 cl::tokenizeConfigFile("\\\r\n", Saver, Actual, /*MarkEOLs=*/false); in TEST()
360 testCommandLineTokenizer(cl::tokenizeConfigFile, Input, Output); in TEST()
366 testCommandLineTokenizer(cl::tokenizeConfigFile, Input, Output); in TEST()
381 StackOption<std::string> Input(cl::Positional); in TEST()
383 cl::alias Alias("alias", llvm::cl::aliasopt(Actual)); in TEST()
385 cl::ParseCommandLineOptions(ARGC, Inputs[i]); in TEST()
394 StackOption<std::string> Option("option", cl::Required); in testAliasRequired()
395 cl::alias Alias("o", llvm::cl::aliasopt(Option)); in testAliasRequired()
397 cl::ParseCommandLineOptions(argc, argv); in testAliasRequired()
413 StackOption<int> TestOption2("hide-option-2", cl::cat(TestCategory)); in TEST()
415 cl::HideUnrelatedOptions(TestCategory); in TEST()
417 ASSERT_EQ(cl::ReallyHidden, TestOption1.getOptionHiddenFlag()) in TEST()
419 ASSERT_EQ(cl::NotHidden, TestOption2.getOptionHiddenFlag()) in TEST()
422 StringMap<cl::Option *> &Map = in TEST()
423 cl::getRegisteredOptions(*cl::TopLevelSubCommand); in TEST()
425 cl::NotHidden == Map["help"]->getOptionHiddenFlag()) in TEST()
429 cl::OptionCategory TestCategory2("Test Options set 2", "Description");
433 StackOption<int> TestOption2("multi-hide-option-2", cl::cat(TestCategory)); in TEST()
434 StackOption<int> TestOption3("multi-hide-option-3", cl::cat(TestCategory2)); in TEST()
436 const cl::OptionCategory *VisibleCategories[] = {&TestCategory, in TEST()
439 cl::HideUnrelatedOptions(makeArrayRef(VisibleCategories)); in TEST()
441 ASSERT_EQ(cl::ReallyHidden, TestOption1.getOptionHiddenFlag()) in TEST()
443 ASSERT_EQ(cl::NotHidden, TestOption2.getOptionHiddenFlag()) in TEST()
445 ASSERT_EQ(cl::NotHidden, TestOption3.getOptionHiddenFlag()) in TEST()
448 StringMap<cl::Option *> &Map = in TEST()
449 cl::getRegisteredOptions(*cl::TopLevelSubCommand); in TEST()
451 cl::NotHidden == Map["help"]->getOptionHiddenFlag()) in TEST()
458 EXPECT_TRUE(cl::ParseCommandLineOptions(array_lengthof(args), args, in TEST()
464 cl::ResetCommandLineParser(); in TEST()
469 StackOption<bool> TopLevelOpt("top-level", cl::init(false)); in TEST()
470 StackOption<bool> SC1Opt("sc1", cl::sub(SC1), cl::init(false)); in TEST()
471 StackOption<bool> SC2Opt("sc2", cl::sub(SC2), cl::init(false)); in TEST()
478 cl::ParseCommandLineOptions(2, args, StringRef(), &llvm::nulls())); in TEST()
485 cl::ResetAllOptionOccurrences(); in TEST()
491 cl::ParseCommandLineOptions(3, args2, StringRef(), &llvm::nulls())); in TEST()
498 cl::ResetAllOptionOccurrences(); in TEST()
504 cl::ParseCommandLineOptions(3, args3, StringRef(), &llvm::nulls())); in TEST()
511 cl::ResetCommandLineParser(); in TEST()
516 StackOption<bool> SC1Opt("sc1", cl::sub(SC1), cl::init(false)); in TEST()
517 StackOption<bool> SC2Opt("sc2", cl::sub(SC2), cl::init(false)); in TEST()
523 EXPECT_FALSE(cl::ParseCommandLineOptions(3, args, StringRef(), &OS)); in TEST()
529 cl::ResetCommandLineParser(); in TEST()
532 StackOption<bool> AllOpt("everywhere", cl::sub(*cl::AllSubCommands), in TEST()
533 cl::init(false)); in TEST()
544 EXPECT_TRUE(cl::ParseCommandLineOptions(2, args, StringRef(), &OS)); in TEST()
549 cl::ResetAllOptionOccurrences(); in TEST()
551 EXPECT_TRUE(cl::ParseCommandLineOptions(3, args2, StringRef(), &OS)); in TEST()
556 cl::ResetAllOptionOccurrences(); in TEST()
558 EXPECT_TRUE(cl::ParseCommandLineOptions(3, args3, StringRef(), &OS)); in TEST()
567 cl::ResetCommandLineParser(); in TEST()
569 StackOption<bool> TopLevelOpt("top-level", cl::sub(*cl::TopLevelSubCommand), in TEST()
570 cl::init(false)); in TEST()
576 cl::ParseCommandLineOptions(2, args, StringRef(), &llvm::nulls())); in TEST()
581 cl::ResetAllOptionOccurrences(); in TEST()
584 cl::ParseCommandLineOptions(2, args, StringRef(), &llvm::nulls())); in TEST()
589 cl::ResetCommandLineParser(); in TEST()
592 StackOption<bool> RemoveOption("remove-option", cl::sub(SC), cl::init(false)); in TEST()
593 StackOption<bool> KeepOption("keep-option", cl::sub(SC), cl::init(false)); in TEST()
601 EXPECT_TRUE(cl::ParseCommandLineOptions(3, args, StringRef(), &OS)); in TEST()
608 cl::ResetAllOptionOccurrences(); in TEST()
609 EXPECT_FALSE(cl::ParseCommandLineOptions(3, args, StringRef(), &OS)); in TEST()
615 cl::ResetCommandLineParser(); in TEST()
618 "top-level-remove", cl::sub(*cl::TopLevelSubCommand), cl::init(false)); in TEST()
620 "top-level-keep", cl::sub(*cl::TopLevelSubCommand), cl::init(false)); in TEST()
626 cl::ParseCommandLineOptions(2, args, StringRef(), &llvm::nulls())); in TEST()
631 cl::ResetAllOptionOccurrences(); in TEST()
633 cl::ParseCommandLineOptions(2, args, StringRef(), &llvm::nulls())); in TEST()
637 cl::ResetCommandLineParser(); in TEST()
641 StackOption<bool> RemoveOption("remove-option", cl::sub(*cl::AllSubCommands), in TEST()
642 cl::init(false)); in TEST()
643 StackOption<bool> KeepOption("keep-option", cl::sub(*cl::AllSubCommands), in TEST()
644 cl::init(false)); in TEST()
653 cl::ParseCommandLineOptions(2, args0, StringRef(), &llvm::nulls())); in TEST()
658 cl::ResetAllOptionOccurrences(); in TEST()
661 cl::ParseCommandLineOptions(3, args1, StringRef(), &llvm::nulls())); in TEST()
666 cl::ResetAllOptionOccurrences(); in TEST()
669 cl::ParseCommandLineOptions(3, args2, StringRef(), &llvm::nulls())); in TEST()
675 cl::ResetAllOptionOccurrences(); in TEST()
677 cl::ParseCommandLineOptions(2, args0, StringRef(), &llvm::nulls())); in TEST()
678 cl::ResetAllOptionOccurrences(); in TEST()
680 cl::ParseCommandLineOptions(3, args1, StringRef(), &llvm::nulls())); in TEST()
681 cl::ResetAllOptionOccurrences(); in TEST()
683 cl::ParseCommandLineOptions(3, args2, StringRef(), &llvm::nulls())); in TEST()
687 cl::ResetCommandLineParser(); in TEST()
690 StackOption<bool> Opt1("opt1", cl::sub(SC1), cl::init(false)); in TEST()
692 StackOption<bool> Opt2("opt2", cl::sub(SC2), cl::init(false)); in TEST()
698 cl::ParseCommandLineOptions(2, args0, StringRef(), &llvm::nulls())); in TEST()
701 for (auto *S : cl::getRegisteredSubcommands()) { in TEST()
707 cl::ResetAllOptionOccurrences(); in TEST()
709 cl::ParseCommandLineOptions(2, args1, StringRef(), &llvm::nulls())); in TEST()
712 for (auto *S : cl::getRegisteredSubcommands()) { in TEST()
720 cl::ResetCommandLineParser(); in TEST()
722 StackOption<std::string> Bar("bar", cl::sub(*cl::AllSubCommands), in TEST()
723 cl::DefaultOption); in TEST()
724 StackOption<std::string, cl::alias> Bar_Alias( in TEST()
725 "b", cl::desc("Alias for -bar"), cl::aliasopt(Bar), cl::DefaultOption); in TEST()
727 StackOption<bool> Foo("foo", cl::init(false), cl::sub(*cl::AllSubCommands), in TEST()
728 cl::DefaultOption); in TEST()
729 StackOption<bool, cl::alias> Foo_Alias("f", cl::desc("Alias for -foo"), in TEST()
730 cl::aliasopt(Foo), cl::DefaultOption); in TEST()
734 StackOption<bool> SC1_B("b", cl::sub(SC1), cl::init(false)); in TEST()
738 StackOption<std::string> SC2_Foo("foo", cl::sub(SC2)); in TEST()
741 EXPECT_TRUE(cl::ParseCommandLineOptions(sizeof(args0) / sizeof(char *), args0, in TEST()
748 cl::ResetAllOptionOccurrences(); in TEST()
751 EXPECT_TRUE(cl::ParseCommandLineOptions(sizeof(args1) / sizeof(char *), args1, in TEST()
757 for (auto *S : cl::getRegisteredSubcommands()) { in TEST()
763 cl::ResetAllOptionOccurrences(); in TEST()
767 EXPECT_TRUE(cl::ParseCommandLineOptions(sizeof(args2) / sizeof(char *), args2, in TEST()
773 for (auto *S : cl::getRegisteredSubcommands()) { in TEST()
778 cl::ResetCommandLineParser(); in TEST()
805 StackOption<std::string, cl::list<std::string>> InputFilenames( in TEST()
806 cl::Positional, cl::desc("<input files>")); in TEST()
807 StackOption<bool> TopLevelOpt("top-level", cl::init(false)); in TEST()
820 cl::ParseCommandLineOptions(2, args, StringRef(), &llvm::nulls())); in TEST()
871 ASSERT_TRUE(llvm::cl::ExpandResponseFiles( in TEST()
872 Saver, llvm::cl::TokenizeGNUCommandLine, Argv, false, true, false, in TEST()
930 cl::TokenizerCallback Tokenizer = cl::TokenizeWindowsCommandLine; in TEST()
932 cl::TokenizerCallback Tokenizer = cl::TokenizeGNUCommandLine; in TEST()
935 cl::ExpandResponseFiles(Saver, Tokenizer, Argv, false, false, false, in TEST()
973 ASSERT_FALSE(cl::ExpandResponseFiles(Saver, cl::TokenizeGNUCommandLine, Argv, in TEST()
1008 ASSERT_TRUE(cl::ExpandResponseFiles(Saver, cl::TokenizeGNUCommandLine, Argv, in TEST()
1028 ASSERT_TRUE(cl::ExpandResponseFiles(Saver, cl::TokenizeWindowsCommandLine, in TEST()
1044 cl::ResetCommandLineParser(); in TEST()
1046 StackOption<std::string> Opt1("opt1", cl::init("true")); in TEST()
1047 StackOption<bool> Opt2("opt2", cl::init(true)); in TEST()
1048 cl::alias Alias("alias", llvm::cl::aliasopt(Opt2)); in TEST()
1049 StackOption<int> Opt3("opt3", cl::init(3)); in TEST()
1054 cl::ParseCommandLineOptions(2, args, StringRef(), &llvm::nulls())); in TEST()
1063 cl::ResetAllOptionOccurrences(); in TEST()
1065 for (auto &OM : cl::getRegisteredOptions(*cl::TopLevelSubCommand)) { in TEST()
1066 cl::Option *O = OM.second; in TEST()
1127 bool Result = llvm::cl::readConfigFile(ConfigFile.path(), Saver, Argv); in TEST()
1153 cl::ResetCommandLineParser(); in TEST()
1155 StackOption<std::string, cl::list<std::string>> PosEatArgs( in TEST()
1156 "positional-eat-args", cl::Positional, cl::desc("<arguments>..."), in TEST()
1157 cl::PositionalEatsArgs); in TEST()
1158 StackOption<std::string, cl::list<std::string>> PosEatArgs2( in TEST()
1159 "positional-eat-args2", cl::Positional, cl::desc("Some strings"), in TEST()
1160 cl::PositionalEatsArgs); in TEST()
1171 EXPECT_FALSE(cl::ParseCommandLineOptions(2, args, StringRef(), &OS)); OS.flush(); in TEST()
1173 EXPECT_FALSE(cl::ParseCommandLineOptions(3, args2, StringRef(), &OS)); OS.flush(); in TEST()
1175 EXPECT_TRUE(cl::ParseCommandLineOptions(3, args3, StringRef(), &OS)); OS.flush(); in TEST()
1178 cl::ResetAllOptionOccurrences(); in TEST()
1179 EXPECT_TRUE(cl::ParseCommandLineOptions(6, args4, StringRef(), &OS)); OS.flush(); in TEST()
1256 StackOption<OptionValue> TestOption(Opt, cl::desc(HelpText), in runTest()
1274 void printOptionInfo(const cl::Option &O, size_t Width) { in printOptionInfo()
1281 runTest(cl::ValueOptional, in TEST_F()
1282 cl::values(clEnumValN(OptionValue::Val, "v1", "desc1"))); in TEST_F()
1293 cl::ValueOptional, cl::values(clEnumValN(OptionValue::Val, "v1", "desc1"), in TEST_F()
1307 cl::ValueOptional, cl::values(clEnumValN(OptionValue::Val, "v1", "desc1"), in TEST_F()
1321 cl::ValueRequired, cl::values(clEnumValN(OptionValue::Val, "v1", "desc1"), in TEST_F()
1334 cl::ValueRequired, cl::values(clEnumValN(OptionValue::Val, "v1", ""))); in TEST_F()
1345 runTest(cl::ValueRequired, in TEST_F()
1346 cl::values(clEnumValN(OptionValue::Val, "v1", in TEST_F()
1371 StackOption<OptionValue> TestOption(ArgName, cl::desc("some help"), in runTest()
1380 size_t getOptionWidth(const cl::Option &O) { return O.getOptionWidth(); } in getOptionWidth()
1387 runTest(ArgName, cl::values(clEnumValN(OptionValue::Val, "v", "help"))), in TEST_F()
1395 runTest("a", cl::values(clEnumValN(OptionValue::Val, OptName, "help"), in TEST_F()
1404 runTest("a", cl::values(clEnumValN(OptionValue::Val, "b", "help"), in TEST_F()
1414 EXPECT_EQ(runTest("a", cl::values(clEnumValN(OptionValue::Val, "b", "help"), in TEST_F()
1428 EXPECT_EQ(runTest(ArgName, cl::ValueOptional, in TEST_F()
1429 cl::values(clEnumValN(OptionValue::Val, "value", "help"), in TEST_F()
1440 EXPECT_EQ(runTest("a", cl::ValueRequired, in TEST_F()
1441 cl::values(clEnumValN(OptionValue::Val, "value", "help"), in TEST_F()
1447 cl::ResetCommandLineParser(); in TEST()
1449 StackOption<std::string, cl::list<std::string>> IncludeDirs( in TEST()
1450 "I", cl::Prefix, cl::desc("Declare an include directory")); in TEST()
1456 cl::ParseCommandLineOptions(2, args, StringRef(), &llvm::nulls())); in TEST()
1461 cl::ResetAllOptionOccurrences(); in TEST()
1468 cl::ParseCommandLineOptions(3, args2, StringRef(), &llvm::nulls())); in TEST()
1473 cl::ResetAllOptionOccurrences(); in TEST()
1479 cl::ParseCommandLineOptions(2, args3, StringRef(), &llvm::nulls())); in TEST()
1483 StackOption<std::string, cl::list<std::string>> MacroDefs( in TEST()
1484 "D", cl::AlwaysPrefix, cl::desc("Define a macro"), in TEST()
1485 cl::value_desc("MACRO[=VALUE]")); in TEST()
1487 cl::ResetAllOptionOccurrences(); in TEST()
1494 cl::ParseCommandLineOptions(2, args4, StringRef(), &llvm::nulls())); in TEST()
1499 cl::ResetAllOptionOccurrences(); in TEST()
1506 cl::ParseCommandLineOptions(3, args5, StringRef(), &llvm::nulls())); in TEST()
1509 cl::ResetAllOptionOccurrences(); in TEST()
1515 cl::ParseCommandLineOptions(2, args6, StringRef(), &llvm::nulls())); in TEST()
1521 cl::ResetCommandLineParser(); in TEST()
1523 StackOption<bool> OptF("f", cl::Grouping, cl::desc("Some flag")); in TEST()
1524 StackOption<bool> OptB("b", cl::Grouping, cl::desc("Another flag")); in TEST()
1525 StackOption<bool> OptD("d", cl::Grouping, cl::ValueDisallowed, in TEST()
1526 cl::desc("ValueDisallowed option")); in TEST()
1527 StackOption<std::string> OptV("v", cl::Grouping, in TEST()
1528 cl::desc("ValueRequired option")); in TEST()
1529 StackOption<std::string> OptO("o", cl::Grouping, cl::ValueOptional, in TEST()
1530 cl::desc("ValueOptional option")); in TEST()
1536 cl::ParseCommandLineOptions(3, args1, StringRef(), &llvm::nulls())); in TEST()
1540 cl::ResetAllOptionOccurrences(); in TEST()
1545 cl::ParseCommandLineOptions(3, args2, StringRef(), &llvm::nulls())); in TEST()
1547 cl::ResetAllOptionOccurrences(); in TEST()
1552 cl::ParseCommandLineOptions(2, args3, StringRef(), &llvm::nulls())); in TEST()
1556 cl::ResetAllOptionOccurrences(); in TEST()
1562 cl::ParseCommandLineOptions(2, args4, StringRef(), &llvm::nulls())); in TEST()
1566 cl::ResetAllOptionOccurrences(); in TEST()
1572 cl::ParseCommandLineOptions(2, args5, StringRef(), &llvm::nulls())); in TEST()
1577 cl::ResetAllOptionOccurrences(); in TEST()
1582 cl::ParseCommandLineOptions(2, args6, StringRef(), &llvm::nulls())); in TEST()
1586 cl::ResetCommandLineParser(); in TEST()
1588 StackOption<bool> OptF("f", cl::Grouping, cl::desc("Some flag")); in TEST()
1589 StackOption<bool> OptB("b", cl::Grouping, cl::desc("Another flag")); in TEST()
1590 StackOption<std::string> OptP("p", cl::Prefix, cl::Grouping, in TEST()
1591 cl::desc("Prefix and Grouping")); in TEST()
1592 StackOption<std::string> OptA("a", cl::AlwaysPrefix, cl::Grouping, in TEST()
1593 cl::desc("AlwaysPrefix and Grouping")); in TEST()
1598 cl::ParseCommandLineOptions(2, args1, StringRef(), &llvm::nulls())); in TEST()
1601 cl::ResetAllOptionOccurrences(); in TEST()
1606 cl::ParseCommandLineOptions(3, args2, StringRef(), &llvm::nulls())); in TEST()
1609 cl::ResetAllOptionOccurrences(); in TEST()
1614 cl::ParseCommandLineOptions(2, args3, StringRef(), &llvm::nulls())); in TEST()
1617 cl::ResetAllOptionOccurrences(); in TEST()
1623 cl::ParseCommandLineOptions(2, args4, StringRef(), &llvm::nulls())); in TEST()
1627 cl::ResetAllOptionOccurrences(); in TEST()
1631 cl::ParseCommandLineOptions(3, args5, StringRef(), &llvm::nulls())); in TEST()
1635 cl::ResetAllOptionOccurrences(); in TEST()
1639 cl::ParseCommandLineOptions(2, args6, StringRef(), &llvm::nulls())); in TEST()
1643 cl::ResetAllOptionOccurrences(); in TEST()
1649 cl::ParseCommandLineOptions(2, args7, StringRef(), &llvm::nulls())); in TEST()
1654 cl::ResetAllOptionOccurrences(); in TEST()
1659 cl::ParseCommandLineOptions(2, args8, StringRef(), &llvm::nulls())); in TEST()
1662 cl::ResetAllOptionOccurrences(); in TEST()
1667 cl::ParseCommandLineOptions(3, args9, StringRef(), &llvm::nulls())); in TEST()
1668 cl::ResetAllOptionOccurrences(); in TEST()
1673 cl::ParseCommandLineOptions(2, args10, StringRef(), &llvm::nulls())); in TEST()
1676 cl::ResetAllOptionOccurrences(); in TEST()
1682 cl::ParseCommandLineOptions(2, args11, StringRef(), &llvm::nulls())); in TEST()
1686 cl::ResetAllOptionOccurrences(); in TEST()
1690 cl::ParseCommandLineOptions(3, args12, StringRef(), &llvm::nulls())); in TEST()
1691 cl::ResetAllOptionOccurrences(); in TEST()
1695 cl::ParseCommandLineOptions(2, args13, StringRef(), &llvm::nulls())); in TEST()
1699 cl::ResetAllOptionOccurrences(); in TEST()
1705 cl::ParseCommandLineOptions(2, args14, StringRef(), &llvm::nulls())); in TEST()
1710 cl::ResetAllOptionOccurrences(); in TEST()
1714 cl::ResetCommandLineParser(); in TEST()
1716 StackOption<bool> OptA("a", cl::desc("Some flag")); in TEST()
1717 StackOption<bool> OptBLong("long-flag", cl::desc("Some long flag")); in TEST()
1718 StackOption<bool, cl::alias> OptB("b", cl::desc("Alias to --long-flag"), in TEST()
1719 cl::aliasopt(OptBLong)); in TEST()
1720 StackOption<std::string> OptAB("ab", cl::desc("Another long option")); in TEST()
1735 cl::ParseCommandLineOptions(4, args1, StringRef(), &OS)); OS.flush(); in TEST()
1740 cl::ResetAllOptionOccurrences(); in TEST()
1743 cl::ParseCommandLineOptions(4, args2, StringRef(), &OS)); OS.flush(); in TEST()
1748 cl::ResetAllOptionOccurrences(); in TEST()
1753 cl::ParseCommandLineOptions(4, args3, StringRef(), &OS)); OS.flush(); in TEST()
1756 cl::ResetAllOptionOccurrences(); in TEST()
1765 EXPECT_FALSE(cl::ParseCommandLineOptions(4, args1, StringRef(), in TEST()
1768 cl::ResetAllOptionOccurrences(); in TEST()
1771 EXPECT_TRUE(cl::ParseCommandLineOptions(4, args2, StringRef(), in TEST()
1774 cl::ResetAllOptionOccurrences(); in TEST()
1777 EXPECT_TRUE(cl::ParseCommandLineOptions(4, args3, StringRef(), in TEST()
1784 cl::ResetAllOptionOccurrences(); in TEST()
1792 cl::ResetCommandLineParser(); in TEST()
1794 StackOption<bool> OptA("a", cl::desc("Some option")); in TEST()
1795 StackOption<bool> OptLong("long", cl::desc("Some long option")); in TEST()
1810 cl::ResetAllOptionOccurrences(); in TEST()
1819 cl::ResetCommandLineParser(); in TEST()
1821 StackOption<bool> OptLong("aluminium", cl::desc("Some long option")); in TEST()
1828 EXPECT_FALSE(cl::ParseCommandLineOptions(2, args, StringRef(), &OS)); in TEST()
1834 cl::ResetAllOptionOccurrences(); in TEST()
1840 cl::ResetCommandLineParser(); in TEST()
1842 StackOption<bool> OptLong("aluminium", cl::desc("Some long option")); in TEST()
1843 StackOption<bool> OptLong2("aluminum", cl::desc("Bad option"), in TEST()
1844 cl::ReallyHidden); in TEST()
1851 EXPECT_FALSE(cl::ParseCommandLineOptions(2, args, StringRef(), &OS)); in TEST()
1857 cl::ResetAllOptionOccurrences(); in TEST()
1861 cl::ResetCommandLineParser(); in TEST()
1863 StackOption<bool> OptA("a", cl::desc("option a")); in TEST()
1865 "b", cl::desc("option b -- This option turns on option a"), in TEST()
1866 cl::callback([&](const bool &) { OptA = true; })); in TEST()
1868 "c", cl::desc("option c -- This option turns on options a and b"), in TEST()
1869 cl::callback([&](const bool &) { OptB = true; })); in TEST()
1870 StackOption<std::string, cl::list<std::string>> List( in TEST()
1872 cl::desc("option list -- This option turns on options a, b, and c when " in TEST()
1874 cl::CommaSeparated, in TEST()
1875 cl::callback([&](const std::string &Str) { in TEST()
1881 EXPECT_TRUE(cl::ParseCommandLineOptions(2, args1)); in TEST()
1886 cl::ResetAllOptionOccurrences(); in TEST()
1889 EXPECT_TRUE(cl::ParseCommandLineOptions(2, args2)); in TEST()
1894 cl::ResetAllOptionOccurrences(); in TEST()
1897 EXPECT_TRUE(cl::ParseCommandLineOptions(2, args3)); in TEST()
1902 cl::ResetAllOptionOccurrences(); in TEST()
1905 EXPECT_TRUE(cl::ParseCommandLineOptions(2, args4)); in TEST()
1910 cl::ResetAllOptionOccurrences(); in TEST()
1913 EXPECT_TRUE(cl::ParseCommandLineOptions(2, args5)); in TEST()
1919 cl::ResetAllOptionOccurrences(); in TEST()
1923 static cl::bits<Enum> ExampleBits(
1924 cl::desc("An example cl::bits to ensure it compiles"),
1925 cl::values(
1930 cl::ResetCommandLineParser(); in TEST()
1933 StackOption<std::string, cl::opt<std::string>> Input(cl::Positional, in TEST()
1934 cl::Required); in TEST()
1935 StackOption<std::string, cl::list<std::string>> ExtraArgs(cl::ConsumeAfter); in TEST()
1941 EXPECT_TRUE(cl::ParseCommandLineOptions(4, Args, StringRef(), &OS)); in TEST()
1951 cl::ResetCommandLineParser(); in TEST()
1954 StackOption<std::string, cl::opt<std::string>> Input1(cl::Positional, in TEST()
1955 cl::Required); in TEST()
1956 StackOption<std::string, cl::opt<std::string>> Input2(cl::Positional, in TEST()
1957 cl::Required); in TEST()
1958 StackOption<std::string, cl::list<std::string>> ExtraArgs(cl::ConsumeAfter); in TEST()
1964 EXPECT_TRUE(cl::ParseCommandLineOptions(5, Args, StringRef(), &OS)); in TEST()
1975 cl::ResetCommandLineParser(); in TEST()
1981 StackOption<Vals, cl::bits<Vals>> Bits( in TEST()
1982 cl::values(clEnumValN(ValA, "enableA", "Enable A"), in TEST()
1985 StackOption<std::string, cl::list<std::string>> Sink(cl::Sink); in TEST()
1986 StackOption<std::string> Input(cl::Positional); in TEST()
1987 StackOption<std::string, cl::list<std::string>> ExtraArgs(cl::ConsumeAfter); in TEST()
1994 EXPECT_TRUE(cl::ParseCommandLineOptions(8, Args, StringRef(), &OS)); in TEST()
2006 cl::ResetAllOptionOccurrences(); in TEST()
2016 cl::ResetCommandLineParser(); in TEST()
2020 StackOption<bool> BoolInitOption("bool-init-option", cl::init(true)); in TEST()
2022 cl::init("str-default-value")); in TEST()
2028 EXPECT_TRUE(cl::ParseCommandLineOptions(1, Args, StringRef(), &OS)); in TEST()
2051 EXPECT_TRUE(cl::ParseCommandLineOptions(5, Args2, StringRef(), &OS)); in TEST()