#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Basic/TargetOptions.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/TextDiagnosticBuffer.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "clang/Serialization/ModuleFileExtension.h"
#include "llvm/TargetParser/Host.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
usingnamespacellvm;
usingnamespaceclang;
Contains;
HasSubstr;
StrEq;
StartsWith;
namespace {
class CommandLineTest : public ::testing::Test { … };
template <typename M>
std::string describeContainsN(M InnerMatcher, unsigned N, bool Negation) { … }
MATCHER_P2(ContainsN, InnerMatcher, N,
describeContainsN(InnerMatcher, N, negation)) { … }
TEST(ContainsN, Empty) { … }
TEST(ContainsN, Zero) { … }
TEST(ContainsN, One) { … }
TEST(ContainsN, Two) { … }
TEST(CompilerInvocationTest, DeepCopyConstructor) { … }
TEST(CompilerInvocationTest, DeepCopyAssignment) { … }
TEST(CompilerInvocationTest, CopyOnWriteConstructor) { … }
TEST(CompilerInvocationTest, CopyOnWriteAssignment) { … }
TEST_F(CommandLineTest, BoolOptionDefaultTrueSingleFlagNotPresent) { … }
TEST_F(CommandLineTest, BoolOptionDefaultTrueSingleFlagPresent) { … }
TEST_F(CommandLineTest, CC1FlagPresentWhenDoingRoundTrip) { … }
TEST_F(CommandLineTest, CC1FlagPresentWhenNotDoingRoundTrip) { … }
TEST_F(CommandLineTest, BoolOptionDefaultTrueSingleFlagUnknownPresent) { … }
TEST_F(CommandLineTest, BoolOptionDefaultTruePresentNone) { … }
TEST_F(CommandLineTest, BoolOptionDefaultTruePresentNegChange) { … }
TEST_F(CommandLineTest, BoolOptionDefaultTruePresentPosReset) { … }
TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentNone) { … }
TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentNegChange) { … }
TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentPosReset) { … }
TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentNoneX) { … }
TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentPosChange) { … }
TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentNegReset) { … }
TEST_F(CommandLineTest, BoolOptionDefaultArbitraryTwoFlagsPresentNone) { … }
TEST_F(CommandLineTest, BoolOptionDefaultArbitraryTwoFlagsPresentChange) { … }
TEST_F(CommandLineTest, BoolOptionDefaultArbitraryTwoFlagsPresentReset) { … }
TEST_F(CommandLineTest, BoolOptionCC1ViaLetPresentNone) { … }
TEST_F(CommandLineTest, BoolOptionCC1ViaLetPresentPos) { … }
TEST_F(CommandLineTest, BoolOptionCC1ViaLetPresentNeg) { … }
TEST_F(CommandLineTest, CanGenerateCC1CommandLineFlag) { … }
TEST_F(CommandLineTest, CanGenerateCC1CommandLineSeparate) { … }
TEST_F(CommandLineTest, CanGenerateCC1CommandLineSeparateRequiredPresent) { … }
TEST_F(CommandLineTest, CanGenerateCC1CommandLineSeparateRequiredAbsent) { … }
TEST_F(CommandLineTest, SeparateEnumNonDefault) { … }
TEST_F(CommandLineTest, SeparateEnumDefault) { … }
TEST_F(CommandLineTest, JoinedEnumNonDefault) { … }
TEST_F(CommandLineTest, JoinedEnumDefault) { … }
TEST_F(CommandLineTest, StringVectorEmpty) { … }
TEST_F(CommandLineTest, StringVectorSingle) { … }
TEST_F(CommandLineTest, StringVectorMultiple) { … }
TEST_F(CommandLineTest, StringVectorCommaJoinedNone) { … }
TEST_F(CommandLineTest, StringVectorCommaJoinedSingle) { … }
TEST_F(CommandLineTest, StringVectorCommaJoinedMultiple) { … }
TEST_F(CommandLineTest, ConditionalParsingIfFalseFlagNotPresent) { … }
TEST_F(CommandLineTest, ConditionalParsingIfFalseFlagPresent) { … }
TEST_F(CommandLineTest, ConditionalParsingIfNonsenseSyclStdArg) { … }
TEST_F(CommandLineTest, ConditionalParsingIfOddSyclStdArg1) { … }
TEST_F(CommandLineTest, ConditionalParsingIfOddSyclStdArg2) { … }
TEST_F(CommandLineTest, ConditionalParsingIfOddSyclStdArg3) { … }
TEST_F(CommandLineTest, ConditionalParsingIfTrueFlagNotPresentHost) { … }
TEST_F(CommandLineTest, ConditionalParsingIfTrueFlagNotPresentDevice) { … }
TEST_F(CommandLineTest, ConditionalParsingIfTrueFlagPresent) { … }
TEST_F(CommandLineTest, WideIntegerHighValue) { … }
TEST_F(CommandLineTest, ImpliedBoolOptionsNoFlagPresent) { … }
TEST_F(CommandLineTest, ImpliedBoolOptionsRootFlagPresent) { … }
TEST_F(CommandLineTest, ImpliedBoolOptionsAllFlagsPresent) { … }
TEST_F(CommandLineTest, ImpliedBoolOptionsImpliedFlagsPresent) { … }
TEST_F(CommandLineTest, PresentAndNotImpliedGenerated) { … }
TEST_F(CommandLineTest, DiagnosticOptionPresent) { … }
TEST_F(CommandLineTest, DigraphsImplied) { … }
TEST_F(CommandLineTest, DigraphsDisabled) { … }
TEST_F(CommandLineTest, DigraphsNotImplied) { … }
TEST_F(CommandLineTest, DigraphsEnabled) { … }
struct DummyModuleFileExtension
: public llvm::RTTIExtends<DummyModuleFileExtension, ModuleFileExtension> { … };
char DummyModuleFileExtension::ID = …;
TEST_F(CommandLineTest, TestModuleFileExtension) { … }
TEST_F(CommandLineTest, RoundTrip) { … }
TEST_F(CommandLineTest, PluginArgsRoundTripDeterminism) { … }
}