1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 #include "test/cctest/cctest.h"
8 #include "src/ast-numbering.h"
9 #include "src/compiler.h"
10 #include "src/compiler/pipeline.h"
11 #include "src/handles.h"
12 #include "src/parser.h"
13 #include "src/rewriter.h"
14 #include "src/scopes.h"
16 using namespace v8::internal;
17 using namespace v8::internal::compiler;
20 HandleAndZoneScope handles;
21 const char* source = "(function(a,b) { return a + b; })";
22 Handle<JSFunction> function = v8::Utils::OpenHandle(
23 *v8::Handle<v8::Function>::Cast(CompileRun(source)));
24 ParseInfo parse_info(handles.main_zone(), function);
25 CHECK(Compiler::ParseAndAnalyze(&parse_info));
26 CompilationInfo info(&parse_info);
28 Pipeline pipeline(&info);
29 #if V8_TURBOFAN_TARGET
30 Handle<Code> code = pipeline.GenerateCode();
31 CHECK(Pipeline::SupportedTarget());
32 CHECK(!code.is_null());