• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// REQUIRES: arm
2// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t
3// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %S/Inputs/far-arm-abs.s -o %tfar
4// RUN: ld.lld  %t %tfar -o %t2
5// RUN: llvm-objdump -d --no-show-raw-insn --triple=armv7a-none-linux-gnueabi %t2 | FileCheck --check-prefix=SHORT %s
6// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %S/Inputs/far-long-arm-abs.s -o %tfarlong
7// RUN: ld.lld  %t %tfarlong -o %t3
8// RUN: llvm-objdump -d --no-show-raw-insn --triple=armv7a-none-linux-gnueabi %t3 | FileCheck --check-prefix=LONG %s
9 .syntax unified
10 .section .text, "ax",%progbits
11 .globl _start
12 .balign 0x10000
13 .type _start,%function
14_start:
15 /// address of too_far symbols are just out of range of ARM branch with
16 /// 26-bit immediate field and an addend of -8
17 bl  too_far1
18 b   too_far2
19 beq too_far3
20
21// SHORT: 00030000 <_start>:
22// SHORT-NEXT:    30000: bl      #4 <__ARMv7ABSLongThunk_too_far1>
23// SHORT-NEXT:    30004: b       #4 <__ARMv7ABSLongThunk_too_far2>
24// SHORT-NEXT:    30008: beq     #4 <__ARMv7ABSLongThunk_too_far3>
25// SHORT:      0003000c <__ARMv7ABSLongThunk_too_far1>:
26// SHORT-NEXT:    3000c: b       #33554420 <__ARMv7ABSLongThunk_too_far3+0x1fffff4>
27// SHORT:      00030010 <__ARMv7ABSLongThunk_too_far2>:
28// SHORT-NEXT:    30010: b       #33554420 <__ARMv7ABSLongThunk_too_far3+0x1fffff8>
29// SHORT:      00030014 <__ARMv7ABSLongThunk_too_far3>:
30// SHORT-NEXT:    30014: b       #33554420 <__ARMv7ABSLongThunk_too_far3+0x1fffffc>
31
32// LONG:      00030000 <_start>:
33// LONG-NEXT:    30000: bl      #4 <__ARMv7ABSLongThunk_too_far1>
34// LONG-NEXT:    30004: b       #12 <__ARMv7ABSLongThunk_too_far2>
35// LONG-NEXT:    30008: beq     #20 <__ARMv7ABSLongThunk_too_far3>
36// LONG:      0003000c <__ARMv7ABSLongThunk_too_far1>:
37// LONG-NEXT:    3000c: movw    r12, #20
38// LONG-NEXT:    30010: movt    r12, #515
39// LONG-NEXT:    30014: bx      r12
40// LONG:      00030018 <__ARMv7ABSLongThunk_too_far2>:
41// LONG-NEXT:    30018: movw    r12, #32
42// LONG-NEXT:    3001c: movt    r12, #515
43// LONG-NEXT:    30020: bx      r12
44// LONG:      00030024 <__ARMv7ABSLongThunk_too_far3>:
45// LONG-NEXT:    30024: movw    r12, #44
46// LONG-NEXT:    30028: movt    r12, #515
47// LONG-NEXT:    3002c: bx      r12