chromium/third_party/angle/src/tests/preprocessor_tests/if_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 "PreprocessorTest.h"
#include "compiler/preprocessor/Token.h"

namespace angle
{

class IfTest : public SimplePreprocessorTest
{};

TEST_F(IfTest, If_0)
{}

TEST_F(IfTest, If_1)
{}

TEST_F(IfTest, If_0_Else)
{}

TEST_F(IfTest, If_1_Else)
{}

TEST_F(IfTest, If_0_Elif)
{}

TEST_F(IfTest, If_1_Elif)
{}

TEST_F(IfTest, If_Elif_Else)
{}

TEST_F(IfTest, If_0_Nested)
{}

TEST_F(IfTest, If_1_Nested)
{}

TEST_F(IfTest, OperatorPrecedence)
{}

TEST_F(IfTest, OperatorDefined)
{}

TEST_F(IfTest, OperatorEQ)
{}

TEST_F(IfTest, OperatorNE)
{}

TEST_F(IfTest, OperatorLess)
{}

TEST_F(IfTest, OperatorGreater)
{}

TEST_F(IfTest, OperatorLE)
{}

TEST_F(IfTest, OperatorGE)
{}

TEST_F(IfTest, OperatorBitwiseOR)
{}

TEST_F(IfTest, OperatorBitwiseAND)
{}

TEST_F(IfTest, OperatorBitwiseXOR)
{}

TEST_F(IfTest, OperatorBitwiseComplement)
{}

TEST_F(IfTest, OperatorLeft)
{}

TEST_F(IfTest, OperatorRight)
{}

TEST_F(IfTest, ExpressionWithMacros)
{}

TEST_F(IfTest, JunkInsideExcludedBlockIgnored)
{}

TEST_F(IfTest, Ifdef)
{}

TEST_F(IfTest, Ifndef)
{}

TEST_F(IfTest, MissingExpression)
{}

TEST_F(IfTest, DivisionByZero)
{}

TEST_F(IfTest, ModuloByZero)
{}

TEST_F(IfTest, DecIntegerOverflow)
{}

TEST_F(IfTest, OctIntegerOverflow)
{}

TEST_F(IfTest, HexIntegerOverflow)
{}

TEST_F(IfTest, UndefinedMacro)
{}

TEST_F(IfTest, InvalidExpressionIgnoredForExcludedElif)
{}

TEST_F(IfTest, ElseWithoutIf)
{}

TEST_F(IfTest, ElifWithoutIf)
{}

TEST_F(IfTest, EndifWithoutIf)
{}

TEST_F(IfTest, ElseAfterElse)
{}

TEST_F(IfTest, ElifAfterElse)
{}

TEST_F(IfTest, UnterminatedIf)
{}

TEST_F(IfTest, UnterminatedIfdef)
{}

// The preprocessor only allows one expression to follow an #if directive.
// Supplying two integer expressions should be an error.
TEST_F(IfTest, ExtraIntExpression)
{}

// The preprocessor only allows one expression to follow an #if directive.
// Supplying two expressions where one uses a preprocessor define should be an error.
TEST_F(IfTest, ExtraIdentifierExpression)
{}

// Divide by zero that's not evaluated because of short-circuiting should not cause an error.
TEST_F(IfTest, ShortCircuitedDivideByZero)
{}

// Undefined identifier that's not evaluated because of short-circuiting should not cause an error.
TEST_F(IfTest, ShortCircuitedUndefined)
{}

// Defined operator produced by macro expansion has undefined behavior according to C++ spec,
// which the GLSL spec references (see C++14 draft spec section 16.1.4), but this behavior is
// needed for passing dEQP tests, which enforce stricter compatibility between implementations.
TEST_F(IfTest, DefinedOperatorValidAfterMacroExpansion)
{}

// Validate the defined operator is evaluated when the macro is called, not when defined.
TEST_F(IfTest, DefinedOperatorValidWhenUsed)
{}

// Validate the defined operator is evaluated when the macro is called, not when defined.
TEST_F(IfTest, DefinedOperatorAfterMacro)
{}

// Test generating "defined" by concatenation when a macro is called. This is not allowed.
TEST_F(IfTest, DefinedInMacroConcatenationNotAllowed)
{}

// Test using defined in a macro parameter name. This is not allowed.
TEST_F(IfTest, DefinedAsParameterNameNotAllowed)
{}

// This behavour is disabled in WebGL.
TEST_F(IfTest, DefinedOperatorInvalidAfterMacroExpansionInWebGL)
{}

// Defined operator produced by macro expansion has undefined behavior according to C++ spec,
// which the GLSL spec references (see C++14 draft spec section 16.1.4). Some edge case
// behaviours with defined are not portable between implementations and thus are not required
// to pass dEQP Tests.
TEST_F(IfTest, UnterminatedDefinedInMacro)
{}

// Defined operator produced by macro expansion has undefined behavior according to C++ spec,
// which the GLSL spec references (see C++14 draft spec section 16.1.4). Some edge case
// behaviours with defined are not portable between implementations and thus are not required
// to pass dEQP Tests.
TEST_F(IfTest, UnterminatedDefinedInMacro2)
{}

// Undefined shift: negative shift offset.
TEST_F(IfTest, BitShiftLeftOperatorNegativeOffset)
{}

// Undefined shift: shift offset is out of range.
TEST_F(IfTest, BitShiftLeftOperatorOffset32)
{}

// Left hand side of shift is negative.
TEST_F(IfTest, BitShiftLeftOperatorNegativeLHS)
{}

// Left shift overflows. Note that the intended result is not explicitly specified, but we assume it
// to do the same operation on the 2's complement bit representation as unsigned shift in C++.
TEST_F(IfTest, BitShiftLeftOverflow)
{}

// Left shift of a negative number overflows. Note that the intended result is not explicitly
// specified, but we assume it to do the same operation on the 2's complement bit representation as
// unsigned shift in C++.
TEST_F(IfTest, BitShiftLeftNegativeOverflow)
{}

// Undefined shift: shift offset is out of range.
TEST_F(IfTest, BitShiftRightOperatorNegativeOffset)
{}

// Undefined shift: shift offset is out of range.
TEST_F(IfTest, BitShiftRightOperatorOffset32)
{}

// Left hand side of shift is negative.
TEST_F(IfTest, BitShiftRightOperatorNegativeLHS)
{}

}  // namespace angle