cf51230881
This affects arm64 and x64. Note that we do not yet optimize these conversions. Later we will add support for merging these conversion operators into other operations during instruction selection. TEST=cctest,compiler-unittests R=jarin@chromium.org Review URL: https://codereview.chromium.org/487723002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23184 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
86 lines
2.4 KiB
C++
86 lines
2.4 KiB
C++
// 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.
|
|
|
|
#ifndef V8_COMPILER_UNITTESTS_COMPILER_UNITTESTS_H_
|
|
#define V8_COMPILER_UNITTESTS_COMPILER_UNITTESTS_H_
|
|
|
|
#include "include/v8.h"
|
|
#include "src/zone.h"
|
|
#include "testing/gtest-support.h"
|
|
|
|
namespace v8 {
|
|
namespace internal {
|
|
namespace compiler {
|
|
|
|
// The TARGET_TEST(Case, Name) macro works just like
|
|
// TEST(Case, Name), except that the test is disabled
|
|
// if the platform is not a supported TurboFan target.
|
|
#if V8_TURBOFAN_TARGET
|
|
#define TARGET_TEST(Case, Name) TEST(Case, Name)
|
|
#else
|
|
#define TARGET_TEST(Case, Name) TEST(Case, DISABLED_##Name)
|
|
#endif
|
|
|
|
|
|
// The TARGET_TEST_F(Case, Name) macro works just like
|
|
// TEST_F(Case, Name), except that the test is disabled
|
|
// if the platform is not a supported TurboFan target.
|
|
#if V8_TURBOFAN_TARGET
|
|
#define TARGET_TEST_F(Case, Name) TEST_F(Case, Name)
|
|
#else
|
|
#define TARGET_TEST_F(Case, Name) TEST_F(Case, DISABLED_##Name)
|
|
#endif
|
|
|
|
|
|
// The TARGET_TEST_P(Case, Name) macro works just like
|
|
// TEST_P(Case, Name), except that the test is disabled
|
|
// if the platform is not a supported TurboFan target.
|
|
#if V8_TURBOFAN_TARGET
|
|
#define TARGET_TEST_P(Case, Name) TEST_P(Case, Name)
|
|
#else
|
|
#define TARGET_TEST_P(Case, Name) TEST_P(Case, DISABLED_##Name)
|
|
#endif
|
|
|
|
|
|
// The TARGET_TYPED_TEST(Case, Name) macro works just like
|
|
// TYPED_TEST(Case, Name), except that the test is disabled
|
|
// if the platform is not a supported TurboFan target.
|
|
#if V8_TURBOFAN_TARGET
|
|
#define TARGET_TYPED_TEST(Case, Name) TYPED_TEST(Case, Name)
|
|
#else
|
|
#define TARGET_TYPED_TEST(Case, Name) TYPED_TEST(Case, DISABLED_##Name)
|
|
#endif
|
|
|
|
|
|
class CompilerTest : public ::testing::Test {
|
|
public:
|
|
CompilerTest();
|
|
virtual ~CompilerTest();
|
|
|
|
Factory* factory() const;
|
|
Isolate* isolate() const { return reinterpret_cast<Isolate*>(isolate_); }
|
|
Zone* zone() { return &zone_; }
|
|
|
|
static void SetUpTestCase();
|
|
static void TearDownTestCase();
|
|
|
|
private:
|
|
static v8::Isolate* isolate_;
|
|
v8::Isolate::Scope isolate_scope_;
|
|
v8::HandleScope handle_scope_;
|
|
v8::Context::Scope context_scope_;
|
|
Zone zone_;
|
|
};
|
|
|
|
|
|
template <typename T>
|
|
class CompilerTestWithParam : public CompilerTest,
|
|
public ::testing::WithParamInterface<T> {};
|
|
|
|
} // namespace compiler
|
|
} // namespace internal
|
|
} // namespace v8
|
|
|
|
#endif // V8_COMPILER_UNITTESTS_COMPILER_UNITTESTS_H_
|