chromium/v8/test/unittests/compiler/simplified-operator-reducer-unittest.cc

// Copyright 2014 the V8 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 "src/compiler/simplified-operator-reducer.h"

#include "src/codegen/tick-counter.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/simplified-operator.h"
#include "src/numbers/conversions-inl.h"
#include "test/unittests/compiler/graph-unittest.h"
#include "test/unittests/compiler/node-test-utils.h"
#include "testing/gmock-support.h"

BitEq;


namespace v8 {
namespace internal {
namespace compiler {
namespace simplified_operator_reducer_unittest {

class SimplifiedOperatorReducerTest : public GraphTest {};


template <typename T>
class SimplifiedOperatorReducerTestWithParam
    : public SimplifiedOperatorReducerTest,
      public ::testing::WithParamInterface<T> {};


namespace {

const double kFloat64Values[] = {
    -V8_INFINITY, -6.52696e+290, -1.05768e+290, -5.34203e+268, -1.01997e+268,
    -8.22758e+266, -1.58402e+261, -5.15246e+241, -5.92107e+226, -1.21477e+226,
    -1.67913e+188, -1.6257e+184, -2.60043e+170, -2.52941e+168, -3.06033e+116,
    -4.56201e+52, -3.56788e+50, -9.9066e+38, -3.07261e+31, -2.1271e+09,
    -1.91489e+09, -1.73053e+09, -9.30675e+08, -26030, -20453, -15790, -11699,
    -111, -97, -78, -63, -58, -1.53858e-06, -2.98914e-12, -1.14741e-39,
    -8.20347e-57, -1.48932e-59, -3.17692e-66, -8.93103e-81, -3.91337e-83,
    -6.0489e-92, -8.83291e-113, -4.28266e-117, -1.92058e-178, -2.0567e-192,
    -1.68167e-194, -1.51841e-214, -3.98738e-234, -7.31851e-242, -2.21875e-253,
    -1.11612e-293, -0.0, 0.0, 2.22507e-308, 1.06526e-307, 4.16643e-227,
    6.76624e-223, 2.0432e-197, 3.16254e-184, 1.37315e-173, 2.88603e-172,
    1.54155e-99, 4.42923e-81, 1.40539e-73, 5.4462e-73, 1.24064e-58, 3.11167e-58,
    2.75826e-39, 0.143815, 58, 67, 601, 7941, 11644, 13697, 25680, 29882,
    1.32165e+08, 1.62439e+08, 4.16837e+08, 9.59097e+08, 1.32491e+09, 1.8728e+09,
    1.0672e+17, 2.69606e+46, 1.98285e+79, 1.0098e+82, 7.93064e+88, 3.67444e+121,
    9.36506e+123, 7.27954e+162, 3.05316e+168, 1.16171e+175, 1.64771e+189,
    1.1622e+202, 2.00748e+239, 2.51778e+244, 3.90282e+306, 1.79769e+308,
    V8_INFINITY};


const int32_t kInt32Values[] =;

const double kNaNs[] = {-std::numeric_limits<double>::quiet_NaN(),
                        std::numeric_limits<double>::quiet_NaN(),
                        base::bit_cast<double>(uint64_t{0x7FFFFFFFFFFFFFFF}),
                        base::bit_cast<double>(uint64_t{0xFFFFFFFFFFFFFFFF})};

const CheckForMinusZeroMode kCheckForMinusZeroModes[] =;

}  // namespace


// -----------------------------------------------------------------------------
// BooleanNot


TEST_F(SimplifiedOperatorReducerTest, BooleanNotWithBooleanNot) {}


TEST_F(SimplifiedOperatorReducerTest, BooleanNotWithFalseConstant) {}


TEST_F(SimplifiedOperatorReducerTest, BooleanNotWithTrueConstant) {}


// -----------------------------------------------------------------------------
// ChangeTaggedToBit

TEST_F(SimplifiedOperatorReducerTest, ChangeBitToTaggedWithChangeTaggedToBit) {}

TEST_F(SimplifiedOperatorReducerTest, ChangeBitToTaggedWithZeroConstant) {}

TEST_F(SimplifiedOperatorReducerTest, ChangeBitToTaggedWithOneConstant) {}


// -----------------------------------------------------------------------------
// ChangeTaggedToBit

TEST_F(SimplifiedOperatorReducerTest, ChangeTaggedToBitWithFalseConstant) {}

TEST_F(SimplifiedOperatorReducerTest, ChangeTaggedToBitWithTrueConstant) {}

TEST_F(SimplifiedOperatorReducerTest, ChangeTaggedToBitWithChangeBitToTagged) {}

// -----------------------------------------------------------------------------
// ChangeFloat64ToTagged

TEST_F(SimplifiedOperatorReducerTest, ChangeFloat64ToTaggedWithConstant) {}

// -----------------------------------------------------------------------------
// ChangeInt32ToTagged


TEST_F(SimplifiedOperatorReducerTest, ChangeInt32ToTaggedWithConstant) {}


// -----------------------------------------------------------------------------
// ChangeTaggedToFloat64


TEST_F(SimplifiedOperatorReducerTest,
       ChangeTaggedToFloat64WithChangeFloat64ToTagged) {}

TEST_F(SimplifiedOperatorReducerTest,
       ChangeTaggedToFloat64WithChangeInt32ToTagged) {}


TEST_F(SimplifiedOperatorReducerTest,
       ChangeTaggedToFloat64WithChangeUint32ToTagged) {}


TEST_F(SimplifiedOperatorReducerTest, ChangeTaggedToFloat64WithConstant) {}


TEST_F(SimplifiedOperatorReducerTest, ChangeTaggedToFloat64WithNaNConstant) {}


// -----------------------------------------------------------------------------
// ChangeTaggedToInt32

TEST_F(SimplifiedOperatorReducerTest,
       ChangeTaggedToInt32WithChangeFloat64ToTagged) {}

TEST_F(SimplifiedOperatorReducerTest,
       ChangeTaggedToInt32WithChangeInt32ToTagged) {}


// -----------------------------------------------------------------------------
// ChangeTaggedToUint32

TEST_F(SimplifiedOperatorReducerTest,
       ChangeTaggedToUint32WithChangeFloat64ToTagged) {}

TEST_F(SimplifiedOperatorReducerTest,
       ChangeTaggedToUint32WithChangeUint32ToTagged) {}


// -----------------------------------------------------------------------------
// TruncateTaggedToWord32

TEST_F(SimplifiedOperatorReducerTest,
       TruncateTaggedToWord3WithChangeFloat64ToTagged) {}

TEST_F(SimplifiedOperatorReducerTest, TruncateTaggedToWord32WithConstant) {}

// -----------------------------------------------------------------------------
// CheckedFloat64ToInt32

TEST_F(SimplifiedOperatorReducerTest, CheckedFloat64ToInt32WithConstant) {}

// -----------------------------------------------------------------------------
// CheckHeapObject

TEST_F(SimplifiedOperatorReducerTest, CheckHeapObjectWithChangeBitToTagged) {}

TEST_F(SimplifiedOperatorReducerTest, CheckHeapObjectWithHeapConstant) {}

TEST_F(SimplifiedOperatorReducerTest, CheckHeapObjectWithCheckHeapObject) {}

// -----------------------------------------------------------------------------
// CheckSmi

TEST_F(SimplifiedOperatorReducerTest, CheckSmiWithChangeInt31ToTaggedSigned) {}

TEST_F(SimplifiedOperatorReducerTest, CheckSmiWithNumberConstant) {}

TEST_F(SimplifiedOperatorReducerTest, CheckSmiWithCheckSmi) {}

// -----------------------------------------------------------------------------
// NumberAbs

TEST_F(SimplifiedOperatorReducerTest, NumberAbsWithNumberConstant) {}

// -----------------------------------------------------------------------------
// ObjectIsSmi

TEST_F(SimplifiedOperatorReducerTest, ObjectIsSmiWithChangeBitToTagged) {}

TEST_F(SimplifiedOperatorReducerTest,
       ObjectIsSmiWithChangeInt31ToTaggedSigned) {}

TEST_F(SimplifiedOperatorReducerTest, ObjectIsSmiWithHeapConstant) {}

TEST_F(SimplifiedOperatorReducerTest, ObjectIsSmiWithNumberConstant) {}

// -----------------------------------------------------------------------------
// CheckedInt32Add

TEST_F(SimplifiedOperatorReducerTest,
       CheckedInt32AddConsecutivelyWithConstants) {}

TEST_F(SimplifiedOperatorReducerTest,
       CheckedInt32AddConsecutivelyWithConstantsNoChanged) {}

}  // namespace simplified_operator_reducer_unittest
}  // namespace compiler
}  // namespace internal
}  // namespace v8