74 lines · plain
1# REQUIRES: ppc2# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t.o3# RUN: ld.lld %t.o -o %t4# RUN: llvm-readelf -S %t | FileCheck --check-prefixes=SECTIONS %s5# RUN: llvm-readelf -x .toc %t | FileCheck --check-prefixes=HEX-LE %s6# RUN: llvm-objdump -d %t | FileCheck --check-prefixes=CHECK %s7 8# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t.o9# RUN: ld.lld %t.o -o %t10# RUN: llvm-readelf -S %t | FileCheck --check-prefixes=SECTIONS %s11# RUN: llvm-readelf -x .toc %t | FileCheck --check-prefixes=HEX-BE %s12# RUN: llvm-objdump -d %t | FileCheck --check-prefixes=CHECK %s13 14# .LJT is a local symbol (non-preemptable).15# Test we can perform the toc-indirect to toc-relative relaxation.16 17# SECTIONS: .rodata PROGBITS 00000000100001c818 19# HEX-LE: section '.toc':20# HEX-LE-NEXT: 10020228 c8010010 0000000021 22# HEX-BE: section '.toc':23# HEX-BE-NEXT: 10020228 00000000 100001c824 25# CHECK-LABEL: _start26# CHECK: clrldi 3, 3, 6227# CHECK-NEXT: addis 4, 2, -328# CHECK-NEXT: addi 4, 4, 3268029# CHECK-NEXT: sldi 3, 3, 230 31 .text32 .global _start33 .type _start, @function34_start:35.Lstart_gep:36 addis 2, 12, .TOC.-.Lstart_gep@ha37 addi 2, 2, .TOC.-.Lstart_gep@l38.Lstart_lep:39 .localentry _start, .Lstart_lep-.Lstart_gep40 rldicl 3, 3, 0, 6241 addis 4, 2, .LJTI_TE@toc@ha42 ld 4, .LJTI_TE@toc@l(4)43 sldi 3, 3, 244 lwax 3, 3, 445 add 3, 3, 446 mtctr 347 bctr48 49.LBB1:50 li 3, 051 blr52.LBB2:53 li 3, 1054 blr55.LBB3:56 li 3, 5557 blr58.LBB4:59 li 3, 25560 blr61 62 .section .rodata,"a",@progbits63 .p2align 264.LJT:65 .long .LBB1-.LJT66 .long .LBB2-.LJT67 .long .LBB3-.LJT68 .long .LBB4-.LJT69 70.section .toc,"aw",@progbits71# TOC entry for the jumptable address.72.LJTI_TE:73 .tc .LJT[TC],.LJT74