// // Copyright 2017 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. // // PrunePureLiteralStatements_test.cpp: // Tests for pruning literal statements. // #include "angle_gl.h" #include "gtest/gtest.h" #include "tests/test_utils/compiler_test.h" usingnamespacesh; namespace { class PrunePureLiteralStatementsTest : public MatchOutputCodeTest { … }; // Most basic test for the pruning TEST_F(PrunePureLiteralStatementsTest, FloatLiteralStatement) { … } // Test the pruning works for constructed types too TEST_F(PrunePureLiteralStatementsTest, ConstructorLiteralStatement) { … } // Test the pruning works when the literal is a (non-trivial) expression TEST_F(PrunePureLiteralStatementsTest, ExpressionLiteralStatement) { … } // Test that the pruning happens in the for-loop expression too TEST_F(PrunePureLiteralStatementsTest, ForLoopLiteralExpression) { … } // Test that the pruning correctly handles the pruning inside switch statements - for a switch with // one empty case. TEST_F(PrunePureLiteralStatementsTest, SwitchLiteralExpressionEmptyCase) { … } // Test that the pruning correctly handles the pruning inside switch statements - for a switch with // multiple cases. TEST_F(PrunePureLiteralStatementsTest, SwitchLiteralExpressionEmptyCases) { … } // Test that the pruning correctly handles the pruning inside switch statements - only cases at the // end are deleted TEST_F(PrunePureLiteralStatementsTest, SwitchLiteralExpressionOnlyLastCase) { … } // Test that the pruning correctly handles the pruning inside switch statements - pruning isn't // stopped by literal statements TEST_F(PrunePureLiteralStatementsTest, SwitchLiteralExpressionLiteralDoesntStop) { … } } // namespace