Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / arm-thunk-edgecase.s
blob46b0335236eea9a23a66e2575dbe9b97a80dab8d
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 --no-print-imm-hex --triple=armv7a-none-linux-gnueabi -d %tarm_to_thumb.so | FileCheck --check-prefix=ARM-TO-THUMB %s
14 // RUN: llvm-objdump --no-print-imm-hex -d %tthumb_to_arm.so | FileCheck --check-prefix=THUMB-TO-ARM %s
16 // RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7aeb-none-linux-gnueabi -mcpu=cortex-a8 %s -o %t.o
17 // RUN: ld.lld -shared -Bsymbolic -script %tarm_to_thumb.script %t.o -o %tarm_to_thumb.so
18 // RUN: ld.lld -shared -Bsymbolic -script %tthumb_to_arm.script %t.o -o %tthumb_to_arm.so
19 // RUN: llvm-objdump --no-print-imm-hex --triple=armv7aeb-none-linux-gnueabi -d %tarm_to_thumb.so | FileCheck --check-prefix=ARM-TO-THUMB %s
20 // RUN: llvm-objdump --no-print-imm-hex -d %tthumb_to_arm.so | FileCheck --check-prefix=THUMB-TO-ARM %s
22 // RUN: ld.lld --be8 -shared -Bsymbolic -script %tarm_to_thumb.script %t.o -o %tarm_to_thumb.so
23 // RUN: ld.lld --be8 -shared -Bsymbolic -script %tthumb_to_arm.script %t.o -o %tthumb_to_arm.so
24 // RUN: llvm-objdump --no-print-imm-hex --triple=armv7aeb-none-linux-gnueabi -d %tarm_to_thumb.so | FileCheck --check-prefix=ARM-TO-THUMB %s
25 // RUN: llvm-objdump --no-print-imm-hex -d %tthumb_to_arm.so | FileCheck --check-prefix=THUMB-TO-ARM %s
27 .syntax unified
29 .arm
30 .section .text_armfunc, "ax", %progbits
31 .globl armfunc
32 .type armfunc, %function
33 armfunc:
34 b thumbfunc
36 .thumb
37 .section .text_thumbfunc, "ax", %progbits
38 .globl thumbfunc
39 .thumb_func
40 thumbfunc:
41 b.w armfunc
43 // ARM-TO-THUMB: <__ARMV7PILongThunk_thumbfunc>:
44 // ARM-TO-THUMB-NEXT: 1004: e30fcffd movw r12, #65533
45 // ARM-TO-THUMB-NEXT: 1008: e340c000 movt r12, #0
47 // THUMB-TO-ARM: <__ThumbV7PILongThunk_armfunc>:
48 // THUMB-TO-ARM-NEXT: 1004: f64f 7cfc movw r12, #65532
49 // THUMB-TO-ARM-NEXT: 1008: f2c0 0c00 movt r12, #0