blob: c3661ae9aa3b222d934c2ba2fd6c1275163c00cc [file] [log] [blame]
Reid Spenceredca80b2007-04-15 18:11:57 +00001; The funcresolve pass will (intentionally) llvm-link an _internal_ function
2; body with an external declaration. Because of this, if we LINK an internal
3; function body into a program that already has an external declaration for
4; the function name, we must rename the internal function to something that
5; does not conflict.
Chris Lattner8a143e82003-05-31 21:14:45 +00006
Reid Spenceredca80b2007-04-15 18:11:57 +00007; RUN: echo { define internal i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc
Misha Brukmanb6cb66f2003-09-15 20:04:28 +00008; RUN: llvm-as < %s > %t.2.bc
Dan Gohmanfddaa312008-05-01 23:50:07 +00009; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep internal | not grep @foo(
Chris Lattner8a143e82003-05-31 21:14:45 +000010
Reid Spenceredca80b2007-04-15 18:11:57 +000011declare i32 @foo()
Chris Lattner8a143e82003-05-31 21:14:45 +000012
Reid Spenceredca80b2007-04-15 18:11:57 +000013define i32 @test() {
14 %X = call i32 @foo()
15 ret i32 %X
Chris Lattner8a143e82003-05-31 21:14:45 +000016}
17