Add AArch64 as an experimental target.
[oota-llvm.git] / test / CodeGen / AArch64 / adrp-relocation.ll
1 ; RUN: llc -march=aarch64 -verify-machineinstrs -filetype=obj < %s | elf-dump | FileCheck %s
2
3 define fp128 @testfn() nounwind {
4 entry:
5   ret fp128 0xL00000000000000004004500000000000
6 }
7
8 define fp128 @foo() nounwind {
9 entry:
10   %bar = alloca fp128 ()*, align 8
11   store fp128 ()* @testfn, fp128 ()** %bar, align 8
12   %call = call fp128 @testfn()
13   ret fp128 %call
14 }
15
16 ; The above should produce an ADRP/ADD pair to calculate the address of
17 ; testfn. The important point is that LLVM shouldn't think it can deal with the
18 ; relocation on the ADRP itself (even though it knows everything about the
19 ; relative offsets of testfn and foo) because its value depends on where this
20 ; object file's .text section gets relocated in memory.
21
22 ; CHECK: .rela.text
23
24 ; CHECK: # Relocation 0
25 ; CHECK-NEXT: (('r_offset', 0x0000000000000028)
26 ; CHECK-NEXT:  ('r_sym', 0x00000009)
27 ; CHECK-NEXT:  ('r_type', 0x00000113)
28 ; CHECK-NEXT:  ('r_addend', 0x0000000000000000)
29 ; CHECK-NEXT: ),
30 ; CHECK-NEXT:  Relocation 1
31 ; CHECK-NEXT: (('r_offset', 0x000000000000002c)
32 ; CHECK-NEXT:  ('r_sym', 0x00000009)
33 ; CHECK-NEXT:  ('r_type', 0x00000115)
34 ; CHECK-NEXT:  ('r_addend', 0x0000000000000000)
35 ; CHECK-NEXT: ),