[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / ARM / elf-thumbfunc-reloc2.s
blobeb7c3ce70af97d4381833cf8d052e81c38ec78fc
1 // RUN: llvm-mc %s -triple=thumbv7-linux-gnueabi \
2 // RUN: -filetype=obj -o - | llvm-readobj -S --sd -r --symbols - | \
3 // RUN: FileCheck %s
5 // We want to test relocatable thumb function call.
7 .thumb_func
8 foo:
9 .fnstart
10 bx lr
11 .cantunwind
12 .fnend
14 .align 1
15 bar:
16 .fnstart
17 push {r7, lr}
18 bl foo(PLT)
19 pop {r7, pc}
20 .cantunwind
21 .fnend
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: ]
30 // CHECK: Relocations [
31 // CHECK-NEXT: Section {{.*}} .rel.text {
32 // CHECK-NEXT: 0x4 R_ARM_THM_CALL foo
33 // CHECK-NEXT: }
34 // CHECK-NEXT: Section {{.*}} .rel.ARM.exidx {
35 // CHECK-NEXT: 0x0 R_ARM_PREL31 .text
36 // CHECK-NEXT: 0x8 R_ARM_PREL31 .text
37 // CHECK-NEXT: }
38 // CHECK-NEXT: ]
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