[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / arm-fix-cortex-a8-blx.s
blob736bbe25ed3b76a4e9e55c3168686a5c0af1f7b1
1 // REQUIRES: arm
2 // RUN: llvm-mc -filetype=obj -triple=armv7a-linux-gnueabihf --arm-add-build-attributes %s -o %t.o
3 // RUN: ld.lld --fix-cortex-a8 -verbose %t.o -o %t2 2>&1 | FileCheck %s
4 // RUN: llvm-objdump -d --no-show-raw-insn --start-address=0x21ffa --stop-address=0x22008 %t2 | FileCheck --check-prefix=CHECK-PATCH %s
6 /// Test that the patch can work on an unrelocated BLX. Neither clang or GCC
7 /// will emit these without a relocation, but they could be produced by ELF
8 /// processing tools.
10 // CHECK: ld.lld: detected cortex-a8-657419 erratum sequence starting at 21FFE in unpatched output
12 .syntax unified
13 .text
15 .type _start, %function
16 .balign 4096
17 .global _start
18 .arm
19 _start:
20 bx lr
21 .space 4086
22 .thumb
23 /// 32-bit Branch link and exchange spans 2 4KiB regions, preceded by a
24 /// 32-bit non branch instruction. Expect a patch.
25 nop.w
26 /// Encoding for blx _start. Use .inst.n directives to avoid a relocation.
27 .inst.n 0xf7ff
28 .inst.n 0xe800
30 // CHECK-PATCH: 21ffa: nop.w
31 // CHECK-PATCH-NEXT: 21ffe: blx 0x22004 <__CortexA8657417_21FFE>
32 // CHECK-PATCH: 00022004 <__CortexA8657417_21FFE>:
33 // CHECK-PATCH-NEXT: 22004: b 0x21000 <_start>