3 # RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t.o
4 # RUN: ld.lld %t.o -o %t
5 # RUN: llvm-nm %t | FileCheck --check-prefix=NM %s
6 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
8 # RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t.o
9 # RUN: ld.lld %t.o -o %t
10 # RUN: llvm-nm %t | FileCheck --check-prefix=NM %s
11 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
17 .type _start,@function
23 addi 4, 4, .Lfunc_gep0@l
24 # now r4 should contain the address of _start
26 lis 5, .TOC.-.Lfunc_gep0@ha # R_PPC64_REL16_HA
27 addi 5, 5, .TOC.-.Lfunc_gep0@l # R_PPC64_REL16_LO
28 # now r5 should contain the offset s.t. r4 + r5 = TOC base
35 .size _start, .Lfunc_end0-.Lfunc_begin0
37 # NM-DAG: 00000000100281f0 d .TOC.
38 # NM-DAG: 00000000100101d0 T _start
40 # 0x100101d0 = (4097<<16) + 464
41 # CHECK: 100101d0: lis 4, 4097
42 # CHECK-NEXT: 100101d4: addi 4, 4, 464
43 # .TOC. - _start = (2<<16) - 32736
44 # CHECK-NEXT: 100101d8: lis 5, 2
45 # CHECK-NEXT: 100101dc: addi 5, 5, -32736