1// REQUIRES: arm
2// RUN: llvm-mc --triple=thumbv6m-none-eabi --arm-add-build-attributes -filetype=obj -o %t.o %s
3// RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s
4
5 .section .text.0, "ax", %progbits
6 .balign 4
7 .thumb_func
8low:
9 bx lr
10
11 .section .text.1, "ax", %progbits
12 .balign 2
13 .global _start
14 .thumb_func
15_start:
16// CHECK: {{.*}}.s.tmp.o:(.text.1+0x0): relocation R_ARM_THM_PC8 out of range: 18446744073709551612 is not in [0, 1023]
17/// ldr r0, low
18 .inst.n 0x48ff
19 .reloc 0, R_ARM_THM_PC8, low
20// CHECK: {{.*}}.s.tmp.o:(.text.1+0x2): improper alignment for relocation R_ARM_THM_PC8: 0x2 is not aligned to 4 bytes
21/// ldr r1, unaligned
22 .inst.n 0x49ff
23 .reloc 2, R_ARM_THM_PC8, unaligned
24// CHECK: {{.*}}.s.tmp.o:(.text.1+0x4): relocation R_ARM_THM_PC8 out of range: 1024 is not in [0, 1023]
25/// ldr r2, range
26 .inst.n 0x4aff
27 .reloc 4, R_ARM_THM_PC8, range
28
29 .section .text.2, "ax", %progbits
30 .balign 4
31 nop
32 .thumb_func
33unaligned:
34  bx lr
35 .space 1020
36range:
37  bx lr
38