chromium/v8/test/cctest/compiler/test-multiple-return.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 <cmath>
#include <functional>
#include <limits>
#include <memory>

#include "src/base/bits.h"
#include "src/codegen/assembler.h"
#include "src/codegen/compiler.h"
#include "src/codegen/machine-type.h"
#include "src/codegen/macro-assembler.h"
#include "src/compiler/linkage.h"
#include "src/compiler/wasm-compiler.h"
#include "src/objects/objects-inl.h"
#include "src/wasm/function-compiler.h"
#include "src/wasm/wasm-engine.h"
#include "src/wasm/wasm-objects-inl.h"
#include "src/wasm/wasm-opcodes.h"
#include "test/cctest/cctest.h"
#include "test/cctest/compiler/codegen-tester.h"
#include "test/common/value-helper.h"

namespace v8 {
namespace internal {
namespace compiler {

namespace {

CallDescriptor* CreateCallDescriptor(Zone* zone, int return_count,
                                     int param_count, MachineType type) {}

Node* MakeConstant(RawMachineAssembler* m, MachineType type, int value) {}

Node* Add(RawMachineAssembler* m, MachineType type, Node* a, Node* b) {}

Node* Sub(RawMachineAssembler* m, MachineType type, Node* a, Node* b) {}

Node* Mul(RawMachineAssembler* m, MachineType type, Node* a, Node* b) {}

Node* ToInt32(RawMachineAssembler* m, MachineType type, Node* a) {}

std::shared_ptr<wasm::NativeModule> AllocateNativeModule(Isolate* isolate,
                                                         size_t code_size) {}

template <int kMinParamCount, int kMaxParamCount>
void TestReturnMultipleValues(MachineType type, int min_count, int max_count) {}

}  // namespace

// Use 9 parameters as a regression test or https://crbug.com/838098.
#define TEST_MULTI

// Create a frame larger than UINT16_MAX to force TF to use an extra register
// when popping the frame.
TEST(TestReturnMultipleValuesLargeFrame) {}

TEST_MULTI(Int32, MachineType::Int32())
#if (!V8_TARGET_ARCH_32_BIT)
TEST_MULTI(Int64, MachineType::Int64())
#endif
TEST_MULTI(Float32, MachineType::Float32())
TEST_MULTI(Float64, MachineType::Float64())

#undef TEST_MULTI

void ReturnLastValue(MachineType type) {}

TEST(ReturnLastValueInt32) {}
#if (!V8_TARGET_ARCH_32_BIT)
TEST(ReturnLastValueInt64) {}
#endif
TEST(ReturnLastValueFloat32) {}
TEST(ReturnLastValueFloat64) {}

void ReturnSumOfReturns(MachineType type) {}

TEST(ReturnSumOfReturnsInt32) {}
#if (!V8_TARGET_ARCH_32_BIT)
TEST(ReturnSumOfReturnsInt64) {}
#endif
TEST(ReturnSumOfReturnsFloat32) {}
TEST(ReturnSumOfReturnsFloat64) {}

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