From c6f40b6ffb6ba9cd2a911d44f5f1d9417d80fe11 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Sat, 11 Jul 2009 13:56:14 +0000 Subject: [PATCH] Don't use a void return type with a function that returns a value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75364 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/ExecutionEngine/JIT/JITTest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unittests/ExecutionEngine/JIT/JITTest.cpp b/unittests/ExecutionEngine/JIT/JITTest.cpp index 8f29918a992..87f3498facc 100644 --- a/unittests/ExecutionEngine/JIT/JITTest.cpp +++ b/unittests/ExecutionEngine/JIT/JITTest.cpp @@ -30,7 +30,8 @@ namespace { Function *makeReturnGlobal(std::string Name, GlobalVariable *G, Module *M) { std::vector params; - const FunctionType *FTy = FunctionType::get(Type::VoidTy, params, false); + const FunctionType *FTy = FunctionType::get(G->getType()->getElementType(), + params, false); Function *F = Function::Create(FTy, GlobalValue::ExternalLinkage, Name, M); BasicBlock *Entry = BasicBlock::Create("entry", F); IRBuilder<> builder(Entry);