68 lines · plain
1# REQUIRES: ppc2 3# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t.o4# RUN: ld.lld -shared --no-toc-optimize %t.o -o %t5# RUN: llvm-objdump -d %t | FileCheck %s6 7# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t.o8# RUN: ld.lld -shared --no-toc-optimize %t.o -o %t9# RUN: llvm-objdump -d %t | FileCheck %s10 11# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t.o12# RUN: ld.lld -shared %t.o -o %t13# RUN: llvm-objdump -d %t | FileCheck --check-prefix=OPT %s14 15# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t.o16# RUN: ld.lld -shared %t.o -o %t17# RUN: llvm-objdump -d %t | FileCheck --check-prefix=OPT %s18 19 .abiversion 220 .section ".text"21 22 .p2align 223 .global func24 .type func, @function25func:26.Lfunc_gep:27 addis 2, 12, .TOC.-.Lfunc_gep@ha28 addi 2, 2, .TOC.-.Lfunc_gep@l29.Lfunc_lep:30 .localentry func, .-func31 addis 3, 2, a@got@ha32 ld 3, a@got@l(3)33 ld 4, a@got(2)34 lis 5, a@got@h35 ori 5, 5, a@got@l36 li 6, 037 ori 6, 6, a@got38 blr39 40# CHECK-LABEL: func41# CHECK: addis 3, 2, 042# CHECK-NEXT: ld 3, -32760(3)43# CHECK-NEXT: ld 4, -32760(2)44# CHECK-NEXT: lis 5, -145# CHECK-NEXT: ori 5, 5, 3277646# CHECK-NEXT: li 6, 047# CHECK-NEXT: ori 6, 6, 3277648 49# OPT-LABEL: func50# OPT: nop51# OPT-NEXT: ld 3, -32760(2)52# OPT-NEXT: ld 4, -32760(2)53# OPT-NEXT: lis 5, -154# OPT-NEXT: ori 5, 5, 3277655# OPT-NEXT: li 6, 056# OPT-NEXT: ori 6, 6, 3277657 58# Since the got entry for a is .got[1] and the TOC base points to59# .got + 0x8000, the offset for a@got is -0x7FF8 --> -3276060 61 .section ".data"62 .global a63 .type a, @object64 .size a, 465 .p2align 266a:67 .long 0x100068