1 ; RUN: llc -O0 < %s -mtriple armv7-linux-gnueabi -o - \
2 ; RUN: | llvm-mc -triple armv7-linux-gnueabi -filetype=obj -o - \
3 ; RUN: | llvm-readobj -r | FileCheck --check-prefix LINUX %s
5 ; RUN: llc -O0 < %s -mtriple armv7-linux-android -o - \
6 ; RUN: | llvm-mc -triple armv7-linux-android -filetype=obj -o - \
7 ; RUN: | llvm-readobj -r | FileCheck --check-prefix LINUX %s
10 ; RUN: llc -O0 < %s -mtriple armv7-apple-ios -o - \
11 ; RUN: | llvm-mc -triple armv7-apple-ios -filetype=obj -o - \
12 ; RUN: | llvm-readobj -r | FileCheck --check-prefix IOS %s
15 define void @thumb_caller() #0 {
16 call void @internal_arm_fn()
17 call void @global_arm_fn()
18 call void @internal_thumb_fn()
19 call void @global_thumb_fn()
23 define void @arm_caller() #1 {
24 call void @internal_arm_fn()
25 call void @global_arm_fn()
26 call void @internal_thumb_fn()
27 call void @global_thumb_fn()
31 define internal void @internal_thumb_fn() #0 {
35 define void @global_thumb_fn() #0 {
43 define internal void @internal_arm_fn() #1 {
47 define void @global_arm_fn() #1 {
55 attributes #0 = { "target-features"="+thumb-mode" }
56 attributes #1 = { "target-features"="-thumb-mode" }
58 ; LINUX: Section (3) .rel.text {
59 ; LINUX-NEXT: 0x2 R_ARM_THM_CALL internal_arm_fn 0x0
60 ; LINUX-NEXT: 0x6 R_ARM_THM_CALL global_arm_fn 0x0
61 ; LINUX-NEXT: 0xE R_ARM_THM_CALL global_thumb_fn 0x0
62 ; LINUX-NEXT: 0x1C R_ARM_CALL internal_arm_fn 0x0
63 ; LINUX-NEXT: 0x20 R_ARM_CALL global_arm_fn 0x0
64 ; LINUX-NEXT: 0x24 R_ARM_CALL internal_thumb_fn 0x0
65 ; LINUX-NEXT: 0x28 R_ARM_CALL global_thumb_fn 0x0
68 ; IOS: Section __text {
69 ; IOS-NEXT: 0x2C 1 2 1 ARM_RELOC_BR24 0 _global_thumb_fn
70 ; IOS-NEXT: 0x28 1 2 1 ARM_RELOC_BR24 0 _internal_thumb_fn
71 ; IOS-NEXT: 0x24 1 2 1 ARM_RELOC_BR24 0 _global_arm_fn
72 ; IOS-NEXT: 0x20 1 2 1 ARM_RELOC_BR24 0 _internal_arm_fn
73 ; IOS-NEXT: 0x10 1 2 0 ARM_THUMB_RELOC_BR22 0 __text
74 ; IOS-NEXT: 0xC 1 2 0 ARM_THUMB_RELOC_BR22 0 __text
75 ; IOS-NEXT: 0x8 1 2 0 ARM_THUMB_RELOC_BR22 0 __text
76 ; IOS-NEXT: 0x4 1 2 0 ARM_THUMB_RELOC_BR22 0 __text