MCPcopy Create free account
hub / github.com/apache/impala / LoadTestOpt

Method LoadTestOpt

be/src/codegen/llvm-codegen-test.cc:693–712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

691 }
692
693 void LoadTestOpt(scoped_ptr<LlvmCodeGen>& codegen) {
694 const string func("_Z9loop_nullPii");
695 typedef void (*LoopFn)(int*, int);
696
697 string module_file;
698 PathBuilder::GetFullPath("llvm-ir/test-opt.bc", &module_file);
699
700 ASSERT_OK(CreateFromFile(module_file.c_str(), &codegen));
701 EXPECT_TRUE(codegen.get() != nullptr);
702 codegen->EnableOptimizations(true);
703
704 llvm::Function* fn = codegen->GetFunction(func, false);
705 EXPECT_TRUE(fn != nullptr);
706 EXPECT_EQ(fn->arg_size(), 2);
707 CodegenFnPtr<LoopFn> fn_impl;
708 AddFunctionToJit(codegen.get(), fn, &fn_impl);
709
710 ASSERT_OK(FinalizeModule(codegen.get()));
711 ASSERT_TRUE(fn_impl.load() != nullptr);
712 }
713};
714
715TEST_P(LlvmOptTest, OptFunction) {

Callers

nothing calls this directly

Calls 4

EnableOptimizationsMethod · 0.80
getMethod · 0.65
GetFunctionMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected