Index: lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp =================================================================== --- lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -227,7 +227,8 @@ Type *RetTy = FTy->getReturnType(); ffi_type *rtype = ffiTypeFor(RetTy); - if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, NumArgs, rtype, &args[0]) == FFI_OK) { + if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, NumArgs, rtype, args.data()) == + FFI_OK) { SmallVector ret; if (RetTy->getTypeID() != Type::VoidTyID) ret.resize(TD.getTypeStoreSize(RetTy)); Index: test/ExecutionEngine/Interpreter/rand.ll =================================================================== --- /dev/null +++ test/ExecutionEngine/Interpreter/rand.ll @@ -0,0 +1,10 @@ +; RUN: lli -O0 -force-interpreter < %s + +declare void @exit(i32) +declare i32 @rand() + +define i32 @main() { + %ret = call i32 @rand() + call void @exit(i32 0) + ret i32 %ret +}