Lang Hames | 73976f6 | 2016-08-06 22:36:26 +0000 | [diff] [blame] | 1 | ; RUN: lli -jit-kind=orc-lazy -extra-module %p/Inputs/weak-function-2.ll %s |
| 2 | ; |
| 3 | ; Check that functions in two different modules agree on the address of weak |
| 4 | ; function 'baz' |
| 5 | |
| 6 | define linkonce_odr i32 @baz() { |
| 7 | entry: |
| 8 | ret i32 0 |
| 9 | } |
| 10 | |
| 11 | define i8* @foo() { |
| 12 | entry: |
| 13 | ret i8* bitcast (i32 ()* @baz to i8*) |
| 14 | } |
| 15 | |
| 16 | declare i8* @bar() |
| 17 | |
| 18 | define i32 @main(i32 %argc, i8** %argv) { |
| 19 | entry: |
| 20 | %call = tail call i8* @foo() |
| 21 | %call1 = tail call i8* @bar() |
| 22 | %cmp = icmp ne i8* %call, %call1 |
| 23 | %conv = zext i1 %cmp to i32 |
| 24 | ret i32 %conv |
| 25 | } |
| 26 | |