llvm.org GIT mirror llvm / b492843
Add support for PC-relative non-extern relocations to RuntimeDyldMachO. Also replaces testcase for r180790 (support for absolute non-externs relocs) with a more robust version. <rdar://problem/15864721> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200404 91177308-0d34-0410-b5e6-96231b3b80d8 Lang Hames 6 years ago
2 changed file(s) with 18 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
381381 uint64_t Addr;
382382 Sec.getAddress(Addr);
383383 Value.Addend = Addend - Addr;
384 if (IsPCRel)
385 Value.Addend += Offset + NumBytes;
384386 }
385387
386388 if (Arch == Triple::x86_64 && (RelType == MachO::X86_64_RELOC_GOT ||
0 ; RUN: %lli_mcjit %s > /dev/null
1 ; RUN: %lli_mcjit -code-model=small %s > /dev/null
12
2 define i32 @foo(i32 %X, i32 %Y, double %A) {
3 %cond212 = fcmp ueq double %A, 2.000000e+00 ; [#uses=1]
4 %cast110 = zext i1 %cond212 to i32 ; [#uses=1]
5 ret i32 %cast110
3 define i32 @foo(i32 %x, i32 %y, double %d) {
4 entry:
5 %d.int64 = bitcast double %d to i64
6 %d.top64 = lshr i64 %d.int64, 32
7 %d.top = trunc i64 %d.top64 to i32
8 %d.bottom = trunc i64 %d.int64 to i32
9 %topCorrect = icmp eq i32 %d.top, 3735928559
10 %bottomCorrect = icmp eq i32 %d.bottom, 4277009102
11 %right = and i1 %topCorrect, %bottomCorrect
12 %nRight = xor i1 %right, true
13 %retVal = zext i1 %nRight to i32
14 ret i32 %retVal
615 }
716
817 define i32 @main() {
9 %reg212 = call i32 @foo( i32 0, i32 1, double 1.000000e+00 ) ; [#uses=1]
10 ret i32 %reg212
18 entry:
19 %call = call i32 @foo(i32 0, i32 1, double 0xDEADBEEFFEEDFACE)
20 ret i32 %call
1121 }