]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/arm-thunk-edgecase.s
Vendor import of lld trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / test / ELF / arm-thunk-edgecase.s
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 -triple=thumbv7a-none-linux-gnueabi -d %tthumb_to_arm.so | FileCheck -check-prefix=THUMB-TO-ARM %s
15
16 .syntax unified
17
18 .arm
19 .section .text_armfunc, "ax", %progbits
20 .globl armfunc
21 armfunc:
22         b       thumbfunc
23
24 .thumb
25 .section .text_thumbfunc, "ax", %progbits
26 .globl thumbfunc
27 .thumb_func
28 thumbfunc:
29         b.w     armfunc
30
31 // ARM-TO-THUMB:      __ARMV7PILongThunk_thumbfunc:
32 // ARM-TO-THUMB-NEXT:     1004:        fd cf 0f e3         movw        r12, #65533
33 // ARM-TO-THUMB-NEXT:     1008:        00 c0 40 e3         movt        r12, #0
34
35 // THUMB-TO-ARM:      __ThumbV7PILongThunk_armfunc:
36 // THUMB-TO-ARM-NEXT:     1004:        4f f6 fc 7c         movw        r12, #65532
37 // THUMB-TO-ARM-NEXT:     1008:        c0 f2 00 0c         movt        r12, #0