2014-07-30 13:54:45 +00:00
|
|
|
// 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 "test/cctest/compiler/instruction-selector-tester.h"
|
|
|
|
|
|
|
|
using namespace v8::internal;
|
|
|
|
using namespace v8::internal::compiler;
|
|
|
|
|
2014-07-31 11:59:49 +00:00
|
|
|
#if V8_TURBOFAN_TARGET
|
|
|
|
|
2014-07-30 13:54:45 +00:00
|
|
|
TEST(InstructionSelectionReturnZero) {
|
|
|
|
InstructionSelectorTester m(InstructionSelectorTester::kInternalMode);
|
|
|
|
m.Return(m.Int32Constant(0));
|
|
|
|
m.SelectInstructions();
|
2014-07-30 16:21:36 +00:00
|
|
|
CHECK_EQ(2, static_cast<int>(m.code.size()));
|
2014-07-30 13:54:45 +00:00
|
|
|
CHECK_EQ(kArchNop, m.code[0]->opcode());
|
|
|
|
CHECK_EQ(kArchRet, m.code[1]->opcode());
|
2014-07-30 16:21:36 +00:00
|
|
|
CHECK_EQ(1, static_cast<int>(m.code[1]->InputCount()));
|
2014-07-30 13:54:45 +00:00
|
|
|
}
|
2014-07-31 11:59:49 +00:00
|
|
|
|
|
|
|
#endif
|