chromium/third_party/dawn/src/tint/lang/core/constant/eval_builtin_test.cc

// Copyright 2021 The Dawn & Tint Authors
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
//    list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its
//    contributors may be used to endorse or promote products derived from
//    this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "src/tint/lang/core/constant/eval_test.h"

#include "src/tint/utils/result/result.h"

usingnamespacetint::core::number_suffixes;  // NOLINT
HasSubstr;

namespace tint::core::constant::test {
namespace {

struct Case {};

static std::ostream& operator<<(std::ostream& o, const Case& c) {}

ScalarTypes;

/// Creates a Case with Values for args and result
static Case C(std::initializer_list<Value> args, Value result) {}

/// Creates a Case with Values for args and result
static Case C(std::initializer_list<Value> args, std::initializer_list<Value> results) {}

/// Convenience overload that creates a Case with just scalars
static Case C(std::initializer_list<ScalarTypes> sargs, ScalarTypes sresult) {}

/// Creates a Case with Values for args and result
static Case C(std::initializer_list<ScalarTypes> sargs,
              std::initializer_list<ScalarTypes> sresults) {}

/// Creates a Case with Values for args and expected error
static Case E(std::initializer_list<Value> args, std::string err) {}

/// Convenience overload that creates an expected-error Case with just scalars
static Case E(std::initializer_list<ScalarTypes> sargs, std::string err) {}

ConstEvalBuiltinTest;

TEST_P(ConstEvalBuiltinTest, Test) {}

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> AbsCases() {}
INSTANTIATE_TEST_SUITE_P();

static std::vector<Case> AllCases() {}
INSTANTIATE_TEST_SUITE_P();

static std::vector<Case> AnyCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> Atan2Cases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> AtanCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> AtanhCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> AcosCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> AcoshCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> AsinCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> AsinhCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> CeilCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> ClampCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> CosCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> CoshCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> CountLeadingZerosCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> CountTrailingZerosCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> CountOneBitsCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> CrossCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> DistanceCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> DotCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> DeterminantCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> FaceForwardCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> FirstLeadingBitCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> FirstTrailingBitCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> FloorCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> FmaCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> FractCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> FrexpCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> InsertBitsCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> InverseSqrtCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> DegreesAFloatCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> DegreesF32Cases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> DegreesF16Cases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> ExpCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> Exp2Cases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> ExtractBitsCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> LdexpCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> LengthCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> LogCases() {}
INSTANTIATE_TEST_SUITE_P();
template <typename T>
std::vector<Case> LogF16Cases() {}
INSTANTIATE_TEST_SUITE_P();
template <typename T>
std::vector<Case> LogF32Cases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> LogAbstractCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> Log2Cases() {}
INSTANTIATE_TEST_SUITE_P();
template <typename T>
std::vector<Case> Log2F16Cases() {}
INSTANTIATE_TEST_SUITE_P();
template <typename T>
std::vector<Case> Log2F32Cases() {}
INSTANTIATE_TEST_SUITE_P();
template <typename T>
std::vector<Case> Log2AbstractCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> MaxCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> MinCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> MixCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> ModfCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> NormalizeCases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Pack4x8snormCases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Pack4x8unormCases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Pack2x16floatCases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Pack2x16snormCases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Pack2x16unormCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> PowCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> ReverseBitsCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> ReflectCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> RefractCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> RadiansCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> RadiansF16Cases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> RoundCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> SaturateCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> SelectCases() {}
static std::vector<Case> SelectBoolCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> SignCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> SinCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> SinhCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> SmoothstepCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> StepCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> SqrtCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> TanCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> TanhCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> TransposeCases() {}
INSTANTIATE_TEST_SUITE_P();

template <typename T>
std::vector<Case> TruncCases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Unpack4x8snormCases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Unpack4x8unormCases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Unpack2x16floatCases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Unpack2x16snormCases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Unpack2x16unormCases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> QuantizeToF16Cases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Dot4I8PackedCases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Dot4U8PackedCases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Pack4xI8Cases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Pack4xU8Cases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Pack4xI8ClampCases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Pack4xU8ClampCases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Unpack4xI8Cases() {}
INSTANTIATE_TEST_SUITE_P();

std::vector<Case> Unpack4xU8Cases() {}
INSTANTIATE_TEST_SUITE_P();
}  // namespace
}  // namespace tint::core::constant::test