Peter Smith | 4923930 | 2018-11-21 11:30:03 | [diff] [blame] | 1 | // REQUIRES: arm |
Peter Smith | f6ed9dd | 2018-05-08 09:26:06 | [diff] [blame] | 2 | // RUN: llvm-mc %s --arm-add-build-attributes --triple=armv7a-linux-gnueabihf --filetype=obj -o %t.o |
| 3 | // RUN: ld.lld %t.o -o %t |
Fangrui Song | 024bf27d | 2019-08-27 11:52:36 | [diff] [blame] | 4 | // RUN: llvm-objdump -triple=thumbv7a -d --start-address=0x2110b4 --stop-address=0x2110be %t | FileCheck %s |
Peter Smith | f6ed9dd | 2018-05-08 09:26:06 | [diff] [blame] | 5 | |
| 6 | // Create a conditional branch too far away from a precreated thunk |
| 7 | // section. This will need a thunk section created within range. |
| 8 | .syntax unified |
| 9 | .thumb |
| 10 | |
| 11 | .section .text.0, "ax", %progbits |
| 12 | .space 2 * 1024 * 1024 |
| 13 | .globl _start |
| 14 | .type _start, %function |
| 15 | _start: |
| 16 | // Range of +/- 1 Megabyte, new ThunkSection will need creating after |
| 17 | // .text.1 |
| 18 | beq.w target |
| 19 | .section .text.1, "ax", %progbits |
| 20 | bx lr |
| 21 | |
| 22 | // CHECK: _start: |
Fangrui Song | 024bf27d | 2019-08-27 11:52:36 | [diff] [blame] | 23 | // CHECK-NEXT: 2110b4: 00 f0 00 80 beq.w #0 |
Peter Smith | f6ed9dd | 2018-05-08 09:26:06 | [diff] [blame] | 24 | // CHECK: __Thumbv7ABSLongThunk_target: |
Fangrui Song | 024bf27d | 2019-08-27 11:52:36 | [diff] [blame] | 25 | // CHECK-NEXT: 2110b8: 00 f0 01 90 b.w #12582914 |
| 26 | // CHECK: 2110bc: 70 47 bx lr |
Peter Smith | f6ed9dd | 2018-05-08 09:26:06 | [diff] [blame] | 27 | |
| 28 | .section .text.2, "ax", %progbits |
| 29 | .space 12 * 1024 * 1024 |
| 30 | .globl target |
| 31 | .type target, %function |
| 32 | target: bx lr |