// Copyright 2013 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 "src/v8.h" #include "test/cctest/cctest.h" #include "src/ast-numbering.h" #include "src/compiler.h" #include "src/compiler/pipeline.h" #include "src/handles.h" #include "src/parser.h" #include "src/rewriter.h" #include "src/scopes.h" using namespace v8::internal; using namespace v8::internal::compiler; TEST(PipelineAdd) { HandleAndZoneScope handles; const char* source = "(function(a,b) { return a + b; })"; Handle function = v8::Utils::OpenHandle( *v8::Handle::Cast(CompileRun(source))); ParseInfo parse_info(handles.main_zone(), function); CHECK(Compiler::ParseAndAnalyze(&parse_info)); CompilationInfo info(&parse_info); Pipeline pipeline(&info); #if V8_TURBOFAN_TARGET Handle code = pipeline.GenerateCode(); CHECK(Pipeline::SupportedTarget()); CHECK(!code.is_null()); #else USE(pipeline); #endif }