[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / ppc64-pcrel-long-branch.s
blob88e2b455ed76ad420bf5555352c3ff9f6d0d263d
1 # REQUIRES: ppc
2 # RUN: echo 'SECTIONS { \
3 # RUN: .text_low 0x2000: { *(.text_low) } \
4 # RUN: .text_high 0x2002000 : { *(.text_high) } \
5 # RUN: }' > %t.script
7 # RUN: llvm-mc -filetype=obj -triple=ppc64le %s -o %t.o
8 # RUN: ld.lld -T %t.script %t.o -o %t
9 # RUN: llvm-objdump -d --no-show-raw-insn --mcpu=pwr10 %t | FileCheck %s
11 # RUN: llvm-mc -filetype=obj -triple=ppc64le -defsym HIDDEN=1 %s -o %t.o
12 # RUN: ld.lld -shared -T %t.script %t.o -o %t.so
13 # RUN: llvm-objdump -d --no-show-raw-insn --mcpu=pwr10 %t.so | FileCheck %s
15 # RUN: llvm-mc -filetype=obj -triple=ppc64 %s -o %t.o
16 # RUN: ld.lld -T %t.script %t.o -o %t
17 # RUN: llvm-objdump -d --no-show-raw-insn --mcpu=pwr10 %t | FileCheck %s
19 # RUN: llvm-mc -filetype=obj -triple=ppc64 -defsym HIDDEN=1 %s -o %t.o
20 # RUN: ld.lld -shared -T %t.script %t.o -o %t.so
21 # RUN: llvm-objdump -d --no-show-raw-insn --mcpu=pwr10 %t.so | FileCheck %s
23 # CHECK-LABEL: <_start>:
24 # CHECK-NEXT: 2000: bl 0x2010
25 # CHECK-NEXT: blr
26 # CHECK-NEXT: trap
27 # CHECK-NEXT: trap
29 ## Callee address - program counter = 0x2002000 - 0x2010 = 33554416
30 # CHECK-LABEL: <__gep_setup_high>:
31 # CHECK-NEXT: 2010: paddi 12, 0, 33554416, 1
32 # CHECK-NEXT: mtctr 12
33 # CHECK-NEXT: bctr
35 # CHECK-LABEL: <high>:
36 # CHECK-NEXT: 2002000: blr
38 .section .text_low, "ax", %progbits
39 .globl _start
40 _start:
41 bl high@notoc
42 blr
44 .section .text_high, "ax", %progbits
45 .ifdef HIDDEN
46 .hidden high
47 .endif
48 .globl high
49 high:
50 blr