45 lines · plain
1// REQUIRES: arm2// RUN: llvm-mc --triple=thumbv6m-none-eabi --arm-add-build-attributes -filetype=obj -o %t.o %s3// RUN: ld.lld %t.o -o %t4// RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s5 6/// Test R_ARM_THM_PC8 as used in the adr pseudo instruction. Only positive7/// 4-byte aligned offsets are permitted.8 .section .text.01, "ax", %progbits9 .balign 410 .global _start11 .thumb_func12_start:13/// adr r0, target114 .inst.n 0xa0ff15 .reloc 0, R_ARM_THM_PC8, target116/// adr r1, target217 .inst.n 0xa1ff18 .reloc 2, R_ARM_THM_PC8, target219 .section .text.02, "ax", %progbits20 .balign 421 .global target122 .type target1, %function23target1:24 nop25 bx lr26 .section .text.03, "ax", %progbits27 .balign 428 .space 101629 .type target2, %function30target2:31 nop32 bx lr33 34// CHECK: 000200b4 <_start>:35// CHECK-NEXT: 200b4: adr r0, #036// CHECK-NEXT: 200b6: adr r1, #102037 38// CHECK: 000200b8 <target1>:39// CHECK-NEXT: 200b8: nop40// CHECK-NEXT: 200ba: bx lr41 42// CHECK: 000204b4 <target2>:43// CHECK-NEXT: 204b4: nop44// CHECK-NEXT: 204b6: bx lr45