chromium/third_party/angle/src/tests/preprocessor_tests/define_test.cpp

//
// Copyright 2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//

#include <sstream>

#include "PreprocessorTest.h"
#include "compiler/preprocessor/Token.h"

namespace angle
{

_;

class DefineTest : public SimplePreprocessorTest
{};

TEST_F(DefineTest, NonIdentifier)
{}

TEST_F(DefineTest, RedefinePredefined)
{}

TEST_F(DefineTest, ReservedUnderScore1)
{}

TEST_F(DefineTest, ReservedUnderScore2)
{}

TEST_F(DefineTest, ReservedGL)
{}

TEST_F(DefineTest, ObjRedefineValid)
{}

TEST_F(DefineTest, ObjRedefineInvalid)
{}

TEST_F(DefineTest, FuncRedefineValid)
{}

TEST_F(DefineTest, FuncRedefineInvalid)
{}

TEST_F(DefineTest, ObjBasic)
{}

TEST_F(DefineTest, ObjEmpty)
{}

TEST_F(DefineTest, ObjChain)
{}

TEST_F(DefineTest, ObjChainReverse)
{}

TEST_F(DefineTest, ObjRecursive)
{}

TEST_F(DefineTest, ObjCompositeChain)
{}

TEST_F(DefineTest, ObjCompositeChainReverse)
{}

TEST_F(DefineTest, ObjCompositeRecursive)
{}

TEST_F(DefineTest, ObjChainSelfRecursive)
{}

TEST_F(DefineTest, ObjectLikeWithParens)
{}

TEST_F(DefineTest, FuncEmpty)
{}

TEST_F(DefineTest, FuncNoArgs)
{}

TEST_F(DefineTest, FuncOneArgUnused)
{}

TEST_F(DefineTest, FuncTwoArgsUnused)
{}

TEST_F(DefineTest, FuncOneArg)
{}

TEST_F(DefineTest, FuncTwoArgs)
{}

TEST_F(DefineTest, FuncEmptyArgs)
{}

TEST_F(DefineTest, FuncMacroAsParam)
{}

TEST_F(DefineTest, FuncOneArgMulti)
{}

TEST_F(DefineTest, FuncTwoArgsMulti)
{}

TEST_F(DefineTest, FuncCompose)
{}

TEST_F(DefineTest, FuncArgWithParens)
{}

TEST_F(DefineTest, FuncMacroAsNonMacro)
{}

TEST_F(DefineTest, FuncExtraNewlines)
{}

TEST_F(DefineTest, ChainObjToFunc)
{}

TEST_F(DefineTest, ChainObjToNonFunc)
{}

TEST_F(DefineTest, ChainObjToFuncWithArgs)
{}

TEST_F(DefineTest, ChainObjToFuncCompose)
{}

TEST_F(DefineTest, ChainObjToFuncParensInText1)
{}

TEST_F(DefineTest, ChainObjToFuncParensInText2)
{}

TEST_F(DefineTest, ChainObjToFuncMultiLevel)
{}

TEST_F(DefineTest, ObjToFuncRecursive)
{}

TEST_F(DefineTest, ChainFuncToFuncCompose)
{}

TEST_F(DefineTest, FuncSelfRecursive)
{}

TEST_F(DefineTest, FuncSelfCompose)
{}

TEST_F(DefineTest, FuncSelfComposeNonFunc)
{}

TEST_F(DefineTest, FuncSelfComposeNonFuncMultiTokenArg)
{}

TEST_F(DefineTest, FinalizeUnexpandedMacro)
{}

TEST_F(DefineTest, FuncArgWithCommas)
{}

TEST_F(DefineTest, FuncArgObjMaroWithComma)
{}

TEST_F(DefineTest, FuncLeftParenInMacroRightParenInText)
{}

TEST_F(DefineTest, RepeatedArg)
{}

TEST_F(DefineTest, FuncMissingRightParen)
{}

TEST_F(DefineTest, FuncIncorrectArgCount)
{}

TEST_F(DefineTest, Undef)
{}

TEST_F(DefineTest, UndefPredefined)
{}

TEST_F(DefineTest, UndefRedefine)
{}

// Example from C99 standard section 6.10.3.5 Scope of macro definitions
TEST_F(DefineTest, C99Example)
{}

TEST_F(DefineTest, Predefined_GL_ES)
{}

TEST_F(DefineTest, Predefined_VERSION)
{}

TEST_F(DefineTest, Predefined_LINE1)
{}

TEST_F(DefineTest, Predefined_LINE2)
{}

TEST_F(DefineTest, Predefined_FILE1)
{}

TEST_F(DefineTest, Predefined_FILE2)
{}

// Defined operator produced by macro expansion should be parsed inside #if directives
TEST_F(DefineTest, ExpandedDefinedParsedInsideIf)
{}

// Defined operator produced by macro expansion should not be parsed outside #if directives
TEST_F(DefineTest, ExpandedDefinedNotParsedOutsideIf)
{}

// Test that line directive expressions give errors on negative or undefined shifts.
TEST_F(DefineTest, NegativeShiftInLineDirective)
{}

// Undefining a macro in its invocation parameters produces and error
TEST_F(DefineTest, UndefineInInvocation)
{}

// Undefining a macro before its invocation parameters produces and error
TEST_F(DefineTest, UndefineInInvocationPreLParen)
{}

// The name of the macro "a" is inside an incomplete macro invocation of macro "m()" in its own
// expansion. This should not result in infinite recursion.
TEST_F(DefineTest, RecursiveMacroNameInsideIncompleteMacroInvocationInMacroExpansion)
{}

// The name of the macro "a" is inside an incomplete macro invocation of macro "m()" in its own
// expansion. Then the macro "a" is undef'd. This is a regression test for a memory management bug
// where macro "a" would be freed on undef even though cleaning up the recursive macro invocation
// would still need to refer to macro "a".
TEST_F(DefineTest, UndefInsideRecursiveMacroInvocation)
{}

// The macro invocations form a long chain. The macro expander should protect against stack overflow
// and generate an error in this case.
TEST_F(DefineTest, LongMacroInvocationChain)
{}

// Tests what happens when a line directive is between macro name and parenthesis and unterminated
// argument list. Mainly to explain
// LineDirectiveInvalidNumberWithParenthesisFromFunctionInvocationInMiddleOfUnterminatedFunctionInvocation
TEST_F(DefineTest, LineDirectiveInMiddleOfUnterminatedFunctionInvocation)
{}

// Tests what happens when an invalid line directive is between macro name and parenthesis and
// unterminated argument list. Mainly to explain
// LineDirectiveInvalidNumberWithParenthesisFromFunctionInvocationInMiddleOfUnterminatedFunctionInvocation
TEST_F(DefineTest, LineDirectiveInvalidNumberInMiddleOfUnterminatedFunctionInvocation)
{}

// Tests what happens when an invalid line directive with number coming from a function invocation
// is between macro name and parenthesis and unterminated argument list. Mainly to explain
// LineDirectiveInvalidNumberWithParenthesisFromFunctionInvocationInMiddleOfUnterminatedFunctionInvocation
TEST_F(DefineTest,
       LineDirectiveInvalidNumberFromFunctionInvocationInMiddleOfUnterminatedFunctionInvocation)
{}

// Tests what happens when an invalid line directive with number that has a parenthesis coming from
// a function invocation is between macro name and parenthesis and unterminated argument list. This
// used to assert.
TEST_F(
    DefineTest,
    LineDirectiveInvalidNumberWithParenthesisFromFunctionInvocationInMiddleOfUnterminatedFunctionInvocation)
{}

}  // namespace angle