File: arm-thunk-edgecase.s

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (38 lines) | stat: -rw-r--r-- 1,604 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// REQUIRES: arm
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.o
// RUN: echo "SECTIONS { \
// RUN:           .text_armfunc 0x1000 : { *(.text_armfunc) } \
// RUN:           .text_thumbfunc 0x11010 : { *(.text_thumbfunc) } \
// RUN:       }" > %tarm_to_thumb.script
// RUN: echo "SECTIONS { \
// RUN:           .text_thumbfunc 0x1000 : { *(.text_thumbfunc) } \
// RUN:           .text_armfunc 0x1100c : { *(.text_armfunc) } \
// RUN:       }" > %tthumb_to_arm.script
// RUN: ld.lld -shared -Bsymbolic -script %tarm_to_thumb.script %t.o -o %tarm_to_thumb.so
// RUN: ld.lld -shared -Bsymbolic -script %tthumb_to_arm.script %t.o -o %tthumb_to_arm.so
// RUN: llvm-objdump --triple=armv7a-none-linux-gnueabi -d %tarm_to_thumb.so | FileCheck --check-prefix=ARM-TO-THUMB %s
// RUN: llvm-objdump --triple=thumbv7a-none-linux-gnueabi -d %tthumb_to_arm.so | FileCheck --check-prefix=THUMB-TO-ARM %s

.syntax unified

.arm
.section .text_armfunc, "ax", %progbits
.globl armfunc
.type armfunc, %function
armfunc:
	b	thumbfunc

.thumb
.section .text_thumbfunc, "ax", %progbits
.globl thumbfunc
.thumb_func
thumbfunc:
	b.w	armfunc

// ARM-TO-THUMB:      <__ARMV7PILongThunk_thumbfunc>:
// ARM-TO-THUMB-NEXT:     1004:        fd cf 0f e3         movw        r12, #65533
// ARM-TO-THUMB-NEXT:     1008:        00 c0 40 e3         movt        r12, #0

// THUMB-TO-ARM:      <__ThumbV7PILongThunk_armfunc>:
// THUMB-TO-ARM-NEXT:     1004:        4f f6 fc 7c         movw        r12, #65532
// THUMB-TO-ARM-NEXT:     1008:        c0 f2 00 0c         movt        r12, #0