Home | History | Annotate | Download | only in AArch64
      1 ; RUN: llc -mtriple=aarch64-none-linux-gnu -verify-machineinstrs -filetype=obj < %s | elf-dump | FileCheck %s
      2 
      3 define i64 @testfn() nounwind {
      4 entry:
      5   ret i64 0
      6 }
      7 
      8 define i64 @foo() nounwind {
      9 entry:
     10   %bar = alloca i64 ()*, align 8
     11   store i64 ()* @testfn, i64 ()** %bar, align 8
     12   %call = call i64 @testfn()
     13   ret i64 %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', 0x0000000000000010)
     26 ; CHECK-NEXT:  ('r_sym', 0x00000007)
     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', 0x0000000000000014)
     32 ; CHECK-NEXT:  ('r_sym', 0x00000007)
     33 ; CHECK-NEXT:  ('r_type', 0x00000115)
     34 ; CHECK-NEXT:  ('r_addend', 0x0000000000000000)
     35 ; CHECK-NEXT: ),
     36