#include "llvm/ADT/STLExtras.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/OptTable.h"
#include "llvm/Option/Option.h"
#include "gtest/gtest.h"
usingnamespacellvm;
usingnamespacellvm::opt;
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
enum ID { … };
#define PREFIX …
#include "Opts.inc"
#undef PREFIX
static constexpr const StringLiteral PrefixTable_init[] = …
static constexpr const ArrayRef<StringLiteral>
PrefixTable(PrefixTable_init, std::size(PrefixTable_init) - 1);
enum OptionFlags { … };
enum OptionVisibility { … };
static constexpr OptTable::Info InfoTable[] = …;
namespace {
class TestOptTable : public GenericOptTable { … };
class TestPrecomputedOptTable : public PrecomputedOptTable { … };
}
const char *Args[] = …;
template <typename T> class OptTableTest : public ::testing::Test { … };
template <typename T> class DISABLED_OptTableTest : public ::testing::Test { … };
OptTableTestTypes;
TYPED_TEST_SUITE(…);
TYPED_TEST_SUITE(…);
TYPED_TEST(OptTableTest, OptionParsing) { … }
TYPED_TEST(OptTableTest, ParseWithFlagExclusions) { … }
TYPED_TEST(OptTableTest, ParseWithVisibility) { … }
TYPED_TEST(OptTableTest, ParseAliasInGroup) { … }
TYPED_TEST(OptTableTest, AliasArgs) { … }
TYPED_TEST(OptTableTest, IgnoreCase) { … }
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wself-move"
#endif
TYPED_TEST(OptTableTest, InputArgListSelfAssign) { … }
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
TYPED_TEST(OptTableTest, DoNotIgnoreCase) { … }
TYPED_TEST(OptTableTest, SlurpEmpty) { … }
TYPED_TEST(OptTableTest, Slurp) { … }
TYPED_TEST(OptTableTest, SlurpJoinedEmpty) { … }
TYPED_TEST(OptTableTest, SlurpJoinedOneJoined) { … }
TYPED_TEST(OptTableTest, SlurpJoinedAndSeparate) { … }
TYPED_TEST(OptTableTest, SlurpJoinedButSeparate) { … }
TYPED_TEST(OptTableTest, FlagAliasToJoined) { … }
TYPED_TEST(OptTableTest, FindNearest) { … }
TYPED_TEST(DISABLED_OptTableTest, FindNearestFIXME) { … }
TYPED_TEST(OptTableTest, ParseGroupedShortOptions) { … }
TYPED_TEST(OptTableTest, ParseDashDash) { … }
TYPED_TEST(OptTableTest, UnknownOptions) { … }
TYPED_TEST(OptTableTest, FlagsWithoutValues) { … }
TYPED_TEST(OptTableTest, UnknownGroupedShortOptions) { … }
TYPED_TEST(OptTableTest, PrintMultilineHelpText) { … }