[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / arm-thunk-edgecase.s
blob174ffebbb36997e3326ed174bfa7c81d86b5b834
1 // REQUIRES: arm
2 // RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.o
3 // RUN: echo "SECTIONS { \
4 // RUN: .text_armfunc 0x1000 : { *(.text_armfunc) } \
5 // RUN: .text_thumbfunc 0x11010 : { *(.text_thumbfunc) } \
6 // RUN: }" > %tarm_to_thumb.script
7 // RUN: echo "SECTIONS { \
8 // RUN: .text_thumbfunc 0x1000 : { *(.text_thumbfunc) } \
9 // RUN: .text_armfunc 0x1100c : { *(.text_armfunc) } \
10 // RUN: }" > %tthumb_to_arm.script
11 // RUN: ld.lld -shared -Bsymbolic -script %tarm_to_thumb.script %t.o -o %tarm_to_thumb.so
12 // RUN: ld.lld -shared -Bsymbolic -script %tthumb_to_arm.script %t.o -o %tthumb_to_arm.so
13 // RUN: llvm-objdump --triple=armv7a-none-linux-gnueabi -d %tarm_to_thumb.so | FileCheck --check-prefix=ARM-TO-THUMB %s
14 // RUN: llvm-objdump -d %tthumb_to_arm.so | FileCheck --check-prefix=THUMB-TO-ARM %s
16 .syntax unified
18 .arm
19 .section .text_armfunc, "ax", %progbits
20 .globl armfunc
21 .type armfunc, %function
22 armfunc:
23 b thumbfunc
25 .thumb
26 .section .text_thumbfunc, "ax", %progbits
27 .globl thumbfunc
28 .thumb_func
29 thumbfunc:
30 b.w armfunc
32 // ARM-TO-THUMB: <__ARMV7PILongThunk_thumbfunc>:
33 // ARM-TO-THUMB-NEXT: 1004: fd cf 0f e3 movw r12, #65533
34 // ARM-TO-THUMB-NEXT: 1008: 00 c0 40 e3 movt r12, #0
36 // THUMB-TO-ARM: <__ThumbV7PILongThunk_armfunc>:
37 // THUMB-TO-ARM-NEXT: 1004: 4f f6 fc 7c movw r12, #65532
38 // THUMB-TO-ARM-NEXT: 1008: c0 f2 00 0c movt r12, #0