Propagate relocation info to resolveRelocation.
[oota-llvm.git] / test / ExecutionEngine / MCJIT / 2013-04-04-RelocAddend.ll
1 ; RUN: %lli_mcjit %s
2 ; XFAIL: darwin
3 ;
4 ; Verify relocations to global symbols with addend work correctly.
5 ;
6 ; Compiled from this C code:
7 ;
8 ; int test[2] = { -1, 0 };
9 ; int *p = &test[1];
10
11 ; int main (void)
12 ; {
13 ;   return *p;
14 ; }
15
16
17 @test = global [2 x i32] [i32 -1, i32 0], align 4
18 @p = global i32* getelementptr inbounds ([2 x i32]* @test, i64 0, i64 1), align 8
19
20 define i32 @main() {
21 entry:
22   %0 = load i32** @p, align 8
23   %1 = load i32* %0, align 4
24   ret i32 %1
25 }
26