[LLVMdev] how to use external function?
Eli Friedman
eli.friedman at gmail.com
Wed Mar 9 15:53:28 PST 2011
On Wed, Mar 9, 2011 at 2:07 PM, Amir Mofakhar <pangan at gmail.com> wrote:
> Eli Friedman <eli.friedman <at> gmail.com> writes:
>
>>
>> Try something like the following?
>>
>> llvm-link MyOwnFunction.bc m1.bc -o - | lli
>>
>> -Eli
>>
>
> same error again!
Strange... it works for me. Maybe try reading the docs for llvm-link?
$ llvm-as -o m1.bc
define i32 @main() {
entry:
%tmp0 = call i32 @MyOwnFunction()
ret i32 0
}
declare i32 @MyOwnFunction()
$ llvm-as -o MyOwnFunction.bc
;ModuleID = 'MyOwnFunction'
define i32 @MyOwnFunction() {
entry:
ret i32 55
}
$ llvm-link m1.bc MyOwnFunction.bc -o - | lli
$
-Eli
More information about the llvm-dev
mailing list