54 lines · plain
1# REQUIRES: ppc2 3# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t.o4# RUN: ld.lld --no-toc-optimize %t.o -o %t5# RUN: llvm-readelf -x .rodata -x .R_PPC64_TOC %t | FileCheck %s --check-prefix=DATALE6# 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 --no-toc-optimize %t.o -o %t10# RUN: llvm-readelf -x .rodata -x .R_PPC64_TOC %t | FileCheck %s --check-prefix=DATABE11# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s12 13.text14.global _start15_start:16.Lfoo:17 li 0,118 li 3,4219 sc20 21.section .toc,"aw",@progbits22.L1:23 .quad 22, 37, 89, 4724 25.section .R_PPC64_TOC16_LO_DS,"ax",@progbits26 ld 1, .L1@toc@l(2)27 28# CHECK-LABEL: Disassembly of section .R_PPC64_TOC16_LO_DS:29# CHECK: ld 1, -32760(2)30 31.section .R_PPC64_TOC16_LO,"ax",@progbits32 addi 1, 2, .L1@toc@l33 34# CHECK-LABEL: Disassembly of section .R_PPC64_TOC16_LO:35# CHECK: addi 1, 2, -3276036 37.section .R_PPC64_TOC16_HI,"ax",@progbits38 addis 1, 2, .L1@toc@h39 40# CHECK-LABEL: Disassembly of section .R_PPC64_TOC16_HI:41# CHECK: addis 1, 2, -142 43.section .R_PPC64_TOC,"a",@progbits44 .quad .TOC.@tocbase45 46# SEC: .got PROGBITS 000000001002020847 48## tocbase = .got+0x8000 = 0x1002820849# DATALE-LABEL: section '.R_PPC64_TOC':50# DATALE-NEXT: e8810210 0000000051 52# DATABE-LABEL: section '.R_PPC64_TOC':53# DATABE-NEXT: 00000000 100281e854