llvm/clang/unittests/Frontend/CompilerInvocationTest.cpp

//===- unittests/Frontend/CompilerInvocationTest.cpp - CI tests //---------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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) {}

// Copy constructor/assignment perform deep copy of reference-counted pointers.

TEST(CompilerInvocationTest, DeepCopyConstructor) {}

TEST(CompilerInvocationTest, DeepCopyAssignment) {}

TEST(CompilerInvocationTest, CopyOnWriteConstructor) {}

TEST(CompilerInvocationTest, CopyOnWriteAssignment) {}

// Boolean option with a keypath that defaults to true.
// The only flag with a negative spelling can set the keypath to false.

TEST_F(CommandLineTest, BoolOptionDefaultTrueSingleFlagNotPresent) {}

TEST_F(CommandLineTest, BoolOptionDefaultTrueSingleFlagPresent) {}

TEST_F(CommandLineTest, CC1FlagPresentWhenDoingRoundTrip) {}

TEST_F(CommandLineTest, CC1FlagPresentWhenNotDoingRoundTrip) {}

TEST_F(CommandLineTest, BoolOptionDefaultTrueSingleFlagUnknownPresent) {}

// Boolean option with a keypath that defaults to true.
// The flag with negative spelling can set the keypath to false.
// The flag with positive spelling can reset the keypath to true.

TEST_F(CommandLineTest, BoolOptionDefaultTruePresentNone) {}

TEST_F(CommandLineTest, BoolOptionDefaultTruePresentNegChange) {}

TEST_F(CommandLineTest, BoolOptionDefaultTruePresentPosReset) {}

// Boolean option with a keypath that defaults to false.
// The flag with negative spelling can set the keypath to true.
// The flag with positive spelling can reset the keypath to false.

TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentNone) {}

TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentNegChange) {}

TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentPosReset) {}

// Boolean option with a keypath that defaults to false.
// The flag with positive spelling can set the keypath to true.
// The flag with negative spelling can reset the keypath to false.

TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentNoneX) {}

TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentPosChange) {}

TEST_F(CommandLineTest, BoolOptionDefaultFalsePresentNegReset) {}

// Boolean option with a keypath that defaults to an arbitrary expression.
// The flag with positive spelling can set the keypath to true.
// The flag with negative spelling can set the keypath to false.

TEST_F(CommandLineTest, BoolOptionDefaultArbitraryTwoFlagsPresentNone) {}

TEST_F(CommandLineTest, BoolOptionDefaultArbitraryTwoFlagsPresentChange) {}

TEST_F(CommandLineTest, BoolOptionDefaultArbitraryTwoFlagsPresentReset) {}

// Boolean option that gets the CC1Option flag from a let statement (which
// is applied **after** the record is defined):
//
//   let Flags = [CC1Option] in {
//     defm option : BoolOption<...>;
//   }

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) {}

// CommaJoined option with MarshallingInfoStringVector.

TEST_F(CommandLineTest, StringVectorCommaJoinedNone) {}

TEST_F(CommandLineTest, StringVectorCommaJoinedSingle) {}

TEST_F(CommandLineTest, StringVectorCommaJoinedMultiple) {}

// A flag that should be parsed only if a condition is met.

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) {}

// Wide integer option.

TEST_F(CommandLineTest, WideIntegerHighValue) {}

// Tree of boolean options that can be (directly or transitively) implied by
// their parent:
//
//   * -cl-unsafe-math-optimizations
//     * -cl-mad-enable
//     * -funsafe-math-optimizations
//       * -freciprocal-math

TEST_F(CommandLineTest, ImpliedBoolOptionsNoFlagPresent) {}

TEST_F(CommandLineTest, ImpliedBoolOptionsRootFlagPresent) {}

TEST_F(CommandLineTest, ImpliedBoolOptionsAllFlagsPresent) {}

TEST_F(CommandLineTest, ImpliedBoolOptionsImpliedFlagsPresent) {}

TEST_F(CommandLineTest, PresentAndNotImpliedGenerated) {}

// Diagnostic option.

TEST_F(CommandLineTest, DiagnosticOptionPresent) {}

// Option default depends on language standard.

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) {}
} // anonymous namespace