xref: /llvm-project/llvm/test/ExecutionEngine/JITLink/AArch32/ELF_relocations_thumbv7a.s (revision 55929cd679375d6ee5111edcb881103f57588d0e)
1# Test v7 Thumb features for mixed Arm/Thumb targets
2#
3# RUN: llvm-mc -triple=thumbv7-linux-gnueabi -arm-add-build-attributes -filetype=obj -o %t_thumbv7.o %s
4# RUN: llvm-objdump -r %t_thumbv7.o | FileCheck --check-prefix=CHECK-TYPE %s
5# RUN: llvm-objdump --disassemble %t_thumbv7.o | FileCheck --check-prefix=CHECK-INSTR %s
6# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \
7# RUN:              -slab-page-size 4096 -abs external_func=0x76bbe880 \
8# RUN:              -check %s %t_thumbv7.o
9
10
11	.text
12	.syntax unified
13
14# CHECK-TYPE: {{[0-9a-f]+}} R_ARM_THM_CALL call_target_arm
15# CHECK-INSTR: <call_site>:
16# CHECK-INSTR: f7ff fffe     bl
17# We decode the operand with index 2, because bl generates two leading implicit
18# predicate operands that we have to skip in order to decode the call_target operand
19# jitlink-check: decode_operand(call_site, 2) = call_target_arm - next_pc(call_site)
20	.globl	call_site
21	.type	call_site,%function
22	.p2align	1
23	.code	16
24	.thumb_func
25call_site:
26	bl	call_target_arm
27	.size	call_site, .-call_site
28
29	.globl	call_target_arm
30	.type	call_target_arm,%function
31	.p2align	2
32	.code	32
33call_target_arm:
34	bx	lr
35	.size	call_target_arm, .-call_target_arm
36
37# Empty main function for jitlink to be happy
38	.globl	main
39	.type	main,%function
40	.p2align	1
41	.code	16
42	.thumb_func
43main:
44	bx	lr
45	.size	main,	.-main
46