[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / ppc32-ifunc-nonpreemptible-pic.s
blobcbf9535d68a8410d0544e42fc16e207189e85b4c
1 # REQUIRES: ppc
2 # RUN: llvm-mc -filetype=obj -triple=powerpc %s -o %t.o
3 # RUN: ld.lld -pie %t.o -o %t
4 # RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
5 # RUN: llvm-readelf -s %t | FileCheck --check-prefix=SYM %s
6 # RUN: llvm-readelf -x .got2 %t | FileCheck --check-prefix=HEX %s
7 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
9 # RELOC: .rela.dyn {
10 # RELOC-NEXT: 0x3024C R_PPC_RELATIVE - 0x101A0
11 # RELOC-NEXT: 0x30250 R_PPC_IRELATIVE - 0x10188
12 # RELOC-NEXT: }
14 # SYM: 000101a0 0 FUNC GLOBAL DEFAULT {{.*}} func
15 # HEX: Hex dump of section '.got2':
16 # HEX-NEXT: 0x0003024c 00000000 ....
18 .section .got2,"aw"
19 .long func
21 # CHECK: Disassembly of section .text:
22 # CHECK: <.text>:
23 # CHECK-NEXT: 10188: blr
24 # CHECK: <_start>:
25 # CHECK-NEXT: bl 0x10190
26 # CHECK-EMPTY:
27 # CHECK-NEXT: <00008000.got2.plt_pic32.func>:
28 ## 0x10020114 = 65536*4098+276
29 # CHECK-NEXT: lwz 11, -32764(30)
30 # CHECK-NEXT: mtctr 11
31 # CHECK-NEXT: bctr
32 # CHECK-NEXT: nop
34 .text
35 .globl func
36 .type func, @gnu_indirect_function
37 func:
38 blr
40 .globl _start
41 _start:
42 bl func+0x8000@plt