Reid Spencer | eb2073b | 2007-01-27 21:09:03 +0000 | [diff] [blame] | 1 | ; Test linking two functions with different prototypes and two globals |
Reid Spencer | 9085043 | 2007-01-30 16:16:01 +0000 | [diff] [blame] | 2 | ; in different modules. This is for PR411 |
Dan Gohman | fea1dd0 | 2009-08-25 15:38:29 +0000 | [diff] [blame] | 3 | ; RUN: llvm-as %s -o %t.bar.bc |
Reid Spencer | eb1d74e | 2007-04-16 17:36:08 +0000 | [diff] [blame] | 4 | ; RUN: echo {define i32* @foo(i32 %x) \{ ret i32* @baz \} \ |
Dan Gohman | fea1dd0 | 2009-08-25 15:38:29 +0000 | [diff] [blame] | 5 | ; 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 Spencer | eb2073b | 2007-01-27 21:09:03 +0000 | [diff] [blame] | 8 | declare i32* @foo(...) |
| 9 | define i32* @bar() { |
| 10 | %ret = call i32* (...)* @foo( i32 123 ) |
| 11 | ret i32* %ret |
| 12 | } |
| 13 | @baz = global i32 0 |