2 # RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t.o
3 # RUN: ld.lld %t.o -o %t
4 # RUN: llvm-readelf -S %t | FileCheck --check-prefixes=SECTIONS %s
5 # RUN: llvm-readelf -x .toc %t | FileCheck --check-prefixes=HEX-LE %s
6 # RUN: llvm-objdump -d %t | FileCheck --check-prefixes=CHECK %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-readelf -S %t | FileCheck --check-prefixes=SECTIONS %s
11 # RUN: llvm-readelf -x .toc %t | FileCheck --check-prefixes=HEX-BE %s
12 # RUN: llvm-objdump -d %t | FileCheck --check-prefixes=CHECK %s
14 # .LJT is a local symbol (non-preemptable).
15 # Test we can perform the toc-indirect to toc-relative relaxation.
17 # SECTIONS: .rodata PROGBITS 00000000100001c8
19 # HEX-LE: section '.toc':
20 # HEX-LE-NEXT: 10020228 c8010010 00000000
22 # HEX-BE: section '.toc':
23 # HEX-BE-NEXT: 10020228 00000000 100001c8
26 # CHECK: clrldi 3, 3, 62
27 # CHECK-NEXT: addis 4, 2, -3
28 # CHECK-NEXT: addi 4, 4, 32680
29 # CHECK-NEXT: sldi 3, 3, 2
33 .type _start, @function
36 addis 2, 12, .TOC.-.Lstart_gep@ha
37 addi 2, 2, .TOC.-.Lstart_gep@l
39 .localentry _start, .Lstart_lep-.Lstart_gep
41 addis 4, 2, .LJTI_TE@toc@ha
42 ld 4, .LJTI_TE@toc@l(4)
62 .section .rodata,"a",@progbits
70 .section .toc,"aw",@progbits
71 # TOC entry for the jumptable address.