brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 51aced1 Raw
51 lines · plain
1# RUN: rm -rf %t && mkdir -p %t2# RUN: llvm-mc -triple=armv7-linux-gnueabi -arm-add-build-attributes \3# RUN:         -filetype=obj -o %t/out.o %s4# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 \5# RUN:              -slab-allocate=10Kb -slab-page-size=4096 \6# RUN:              -abs ext=0x76bbe880 -check %s %t/out.o7 8	.text9	.syntax unified10 11# Check that a single external symbol can have multiple stubs. We access them12# with the extra stub-index argument to stub_addr(). Stubs are sorted by13# ascending size (because the default memory manager lays out blocks by size).14 15# Thumb relocation site emits thumb stub16# jitlink-check: decode_operand(test_stub_thumb, 0) = stub_addr(out.o, ext, thumb) - next_pc(test_stub_thumb)17	.globl  test_stub_thumb18	.type	test_stub_thumb,%function19	.p2align	120	.code	1621	.thumb_func22test_stub_thumb:23	b	ext24	.size	test_stub_thumb, .-test_stub_thumb25 26# Arm relocation site emits arm stub27# jitlink-check: decode_operand(test_stub_arm, 0) = stub_addr(out.o, ext, arm) - next_pc(test_stub_arm)28	.globl  test_stub_arm29	.type	test_stub_arm,%function30	.p2align	231	.code	3232test_stub_arm:33	b	ext34	.size	test_stub_arm, .-test_stub_arm35 36# This test is executable with both, Arm and Thumb `ext` functions. It only has37# to return (directly to main) with `bx lr`. For example:38#   > echo "void ext() {}" | clang -target armv7-linux-gnueabihf -o ext-arm.o -c -xc -39#   > llvm-jitlink ext-arm.o out.o40#41	.globl	main42	.type	main,%function43	.p2align	244main:45	push	{lr}46	bl	test_stub_arm47	bl	test_stub_thumb48	movw	r0, #049	pop	{pc}50	.size	main, .-main51