blob: afe0320ba92f0fe648b039c6b1536383a8be531b [file] [log] [blame]
Reid Spencereb2073b2007-01-27 21:09:03 +00001; Test linking two functions with different prototypes and two globals
Reid Spencer90850432007-01-30 16:16:01 +00002; in different modules. This is for PR411
Dan Gohmanfea1dd02009-08-25 15:38:29 +00003; RUN: llvm-as %s -o %t.bar.bc
Reid Spencereb1d74e2007-04-16 17:36:08 +00004; RUN: echo {define i32* @foo(i32 %x) \{ ret i32* @baz \} \
Dan Gohmanfea1dd02009-08-25 15:38:29 +00005; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc
6; RUN: llvm-link %t.bar.bc %t.foo.bc -o %t.bc
7; RUN: llvm-link %t.foo.bc %t.bar.bc -o %t.bc
Reid Spencereb2073b2007-01-27 21:09:03 +00008declare i32* @foo(...)
9define i32* @bar() {
10 %ret = call i32* (...)* @foo( i32 123 )
11 ret i32* %ret
12}
13@baz = global i32 0