• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc %s -triple=thumbv7-linux-gnueabi \
2// RUN: -filetype=obj -o - | llvm-readobj -s -sd -r -t | \
3// RUN: FileCheck %s
4
5// We want to test relocatable thumb function call.
6
7	.thumb_func
8foo:
9	.fnstart
10	bx	lr
11	.cantunwind
12	.fnend
13
14	.align	1
15bar:
16	.fnstart
17	push	{r7, lr}
18	bl	foo(PLT)
19	pop	{r7, pc}
20	.cantunwind
21	.fnend
22
23// make sure that bl 0 <foo> (fff7feff) is correctly encoded
24// CHECK: Sections [
25// CHECK:   SectionData (
26// CHECK:     0000: 704780B5 FFF7FEFF 80BD
27// CHECK:   )
28// CHECK: ]
29
30// CHECK:      Relocations [
31// CHECK-NEXT:   Section {{.*}} .rel.text {
32// CHECK-NEXT:     0x4 R_ARM_THM_CALL foo 0x0
33// CHECK-NEXT:   }
34// CHECK-NEXT:   Section {{.*}} .rel.ARM.exidx {
35// CHECK-NEXT:     0x0 R_ARM_PREL31 .text 0x0
36// CHECK-NEXT:     0x8 R_ARM_PREL31 .text 0x0
37// CHECK-NEXT:   }
38// CHECK-NEXT: ]
39
40// make sure foo is thumb function: bit 0 = 1
41// CHECK:      Symbols [
42// CHECK:        Symbol {
43// CHECK:          Name: foo
44// CHECK-NEXT:     Value: 0x1
45