46 lines · plain
1# REQUIRES: ppc2 3# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t.o4# RUN: ld.lld %t.o -o %t5# RUN: llvm-nm %t | FileCheck --check-prefix=NM %s6# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s7 8# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t.o9# RUN: ld.lld %t.o -o %t10# RUN: llvm-nm %t | FileCheck --check-prefix=NM %s11# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s12 13.text14.abiversion 215.globl _start16.p2align 417.type _start,@function18 19_start:20.Lfunc_begin0:21.Lfunc_gep0:22 lis 4, .Lfunc_gep0@ha23 addi 4, 4, .Lfunc_gep0@l24 # now r4 should contain the address of _start25 26 lis 5, .TOC.-.Lfunc_gep0@ha # R_PPC64_REL16_HA27 addi 5, 5, .TOC.-.Lfunc_gep0@l # R_PPC64_REL16_LO28 # now r5 should contain the offset s.t. r4 + r5 = TOC base29 30 # exit 5531 li 0, 132 li 3, 5533 sc34.Lfunc_end0:35 .size _start, .Lfunc_end0-.Lfunc_begin036 37# NM-DAG: 00000000100281f0 d .TOC.38# NM-DAG: 00000000100101d0 T _start39 40# 0x100101d0 = (4097<<16) + 46441# CHECK: 100101d0: lis 4, 409742# CHECK-NEXT: 100101d4: addi 4, 4, 46443# .TOC. - _start = (2<<16) - 3273644# CHECK-NEXT: 100101d8: lis 5, 245# CHECK-NEXT: 100101dc: addi 5, 5, -3273646