chromium/v8/test/common/value-helper.h

// Copyright 2022 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.

#ifndef V8_COMMON_VALUE_HELPER_H_
#define V8_COMMON_VALUE_HELPER_H_

#include <stdint.h>

#include "src/base/template-utils.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/node-matchers.h"
#include "src/compiler/node.h"
#include "src/execution/isolate.h"
#include "src/objects/objects.h"

namespace v8 {
namespace internal {
namespace compiler {

// A collection of utilities related to numerical and heap values, including
// example input values of various types, including int32_t, uint32_t, double,
// etc.
class ValueHelper {};

template <>
inline base::Vector<const int8_t> ValueHelper::GetVector() {}

template <>
inline base::Vector<const uint8_t> ValueHelper::GetVector() {}

template <>
inline base::Vector<const int16_t> ValueHelper::GetVector() {}

template <>
inline base::Vector<const uint16_t> ValueHelper::GetVector() {}

template <>
inline base::Vector<const int32_t> ValueHelper::GetVector() {}

template <>
inline base::Vector<const uint32_t> ValueHelper::GetVector() {}

template <>
inline base::Vector<const int64_t> ValueHelper::GetVector() {}

template <>
inline base::Vector<const float> ValueHelper::GetVector() {}

template <>
inline base::Vector<const double> ValueHelper::GetVector() {}

// Helper macros that can be used in FOR_INT32_INPUTS(i) { ... i ... }
#define FOR_INPUTS(ctype, itype, var)

#define FOR_INT32_INPUTS(var)
#define FOR_UINT32_INPUTS(var)
#define FOR_INT16_INPUTS(var)
#define FOR_UINT16_INPUTS(var)
#define FOR_INT8_INPUTS(var)
#define FOR_UINT8_INPUTS(var)
#define FOR_INT64_INPUTS(var)
#define FOR_UINT64_INPUTS(var)
#define FOR_FLOAT32_INPUTS(var)
#define FOR_FLOAT64_INPUTS(var)

#define FOR_INT32_SHIFTS(var)

#define FOR_UINT32_SHIFTS(var)

template <typename type>
struct FloatCompareWrapper {};

template <typename type>
std::ostream& operator<<(std::ostream& out, FloatCompareWrapper<type> wrapper) {}

#define CHECK_FLOAT_EQ(lhs, rhs)

#define CHECK_DOUBLE_EQ(lhs, rhs)

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

#endif  // V8_COMMON_VALUE_HELPER_H_