1 # RUN: rm -rf %t && mkdir -p %t
2 # RUN: llvm-mc -triple=thumbv7s-apple-ios7.0.0 -filetype=obj -o %t/MachO_Thumb.o %s
3 # RUN: llvm-rtdyld -triple=thumbv7s-apple-ios7.0.0 -verify -check=%s %t/MachO_Thumb.o
5 .section __TEXT,__text,regular,pure_instructions
8 .globl thumb_caller_thumb_callee
11 .thumb_func thumb_caller_thumb_callee
12 thumb_caller_thumb_callee
:
15 .globl arm_caller_thumb_callee
18 .thumb_func arm_caller_thumb_callee
19 arm_caller_thumb_callee
:
22 .globl thumb_caller_arm_callee
25 thumb_caller_arm_callee
:
31 .thumb_func thumb_caller
35 # Check that stubs for thumb callers use thumb code (not arm), and that thumb
36 # callees have the low bit set on their addresses.
38 # rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, thumb_caller_thumb_callee)) = 0xf000f8df
39 # rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, thumb_caller_thumb_callee) + 4) = (thumb_caller_thumb_callee | 0x1)
40 bl thumb_caller_thumb_callee
42 # Check that arm callees do not have the low bit set on their addresses.
44 # rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, thumb_caller_arm_callee)) = 0xf000f8df
45 # rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, thumb_caller_arm_callee) + 4) = thumb_caller_arm_callee
46 bl thumb_caller_arm_callee
54 # Check that stubs for arm callers use arm code (not thumb), and that thumb
55 # callees have the low bit set on their addresses.
56 # rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, arm_caller_thumb_callee)) = 0xe51ff004
57 # rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, arm_caller_thumb_callee) + 4) = (arm_caller_thumb_callee | 0x1)
58 bl arm_caller_thumb_callee
61 .subsections_via_symbols