108 lines · plain
1# Test v7 Thumb features for Thumb-only targets2#3# RUN: llvm-mc -triple=thumbv7m-linux-gnueabi -arm-add-build-attributes -filetype=obj -o %t_thumbv7m.o %s4# RUN: llvm-objdump -r %t_thumbv7m.o | FileCheck --check-prefix=CHECK-TYPE %s5# RUN: llvm-objdump --disassemble %t_thumbv7m.o | FileCheck --check-prefix=CHECK-INSTR %s6# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \7# RUN: -slab-page-size 4096 -abs ext_func=0x76bbe880 -abs ext_data=0x00001234 \8# RUN: -check %s %t_thumbv7m.o9#10# RUN: llvm-mc -triple=thumbv7-linux-gnueabi -arm-add-build-attributes -filetype=obj -o %t_thumbv7.o %s11# RUN: llvm-objdump -r %t_thumbv7.o | FileCheck --check-prefix=CHECK-TYPE %s12# RUN: llvm-objdump --disassemble %t_thumbv7.o | FileCheck --check-prefix=CHECK-INSTR %s13# RUN: llvm-jitlink -noexec -slab-address 0x76ff0000 -slab-allocate 10Kb \14# RUN: -slab-page-size 4096 -abs ext_func=0x76bbe880 -abs ext_data=0x00001234 \15# RUN: -check %s %t_thumbv7.o16 17 .text18 .syntax unified19 20 21# CHECK-TYPE: {{[0-9a-f]+}} R_ARM_THM_JUMP24 jump24_target22# CHECK-INSTR: <jump24_site>:23# CHECK-INSTR: f7ff bffe b.w24# b.w generates two implicit predicate operands as well, but they are trailing25# operands, so there is no need to adjust the operand index.26# jitlink-check: decode_operand(jump24_site, 0) = jump24_target - next_pc(jump24_site)27 .globl jump24_site28 .type jump24_site,%function29 .p2align 130 .code 1631 .thumb_func32jump24_site:33 b.w jump24_target34 .size jump24_site, .-jump24_site35 36 .globl jump24_target37 .type jump24_target,%function38 .p2align 139 .code 1640 .thumb_func41jump24_target:42 bx lr43 .size jump24_target, .-jump24_target44 45# CHECK-TYPE: {{[0-9a-f]+}} R_ARM_THM_MOVW_ABS_NC ext_data46# CHECK-INSTR: <movw>:47# CHECK-INSTR: f240 0000 movw r0, #0x048# jitlink-check: decode_operand(movw, 1) = ext_data[15:0]49 .globl movw50 .type movw,%function51 .p2align 152 .code 1653 .thumb_func54movw:55 movw r0, :lower16:ext_data56 .size movw, .-movw57 58# CHECK-TYPE: {{[0-9a-f]+}} R_ARM_THM_MOVT_ABS ext_data59# CHECK-INSTR: <movt>:60# CHECK-INSTR: f2c0 0000 movt r0, #0x061# We decode the operand with index 2, because movt generates one leading implicit62# predicate operand that we have to skip in order to decode the ext_data operand63# jitlink-check: decode_operand(movt, 2) = ext_data[31:16]64 .globl movt65 .type movt,%function66 .p2align 167 .code 1668 .thumb_func69movt:70 movt r0, :upper16:ext_data71 .size movt, .-movt72 73# CHECK-TYPE: {{[0-9a-f]+}} R_ARM_THM_MOVW_PREL_NC ext_func74# CHECK-INSTR: <movw_prel>:75# CHECK-INSTR: f240 0000 movw r0, #0x076# jitlink-check: decode_operand(movw_prel, 1) = (ext_func - movw_prel)[15:0]77 .globl movw_prel78 .type movw_prel,%function79 .p2align 180 .code 1681 .thumb_func82movw_prel:83 movw r0, :lower16:ext_func - .84 .size movw_prel, .-movw_prel85 86# CHECK-TYPE: {{[0-9a-f]+}} R_ARM_THM_MOVT_PREL ext_func87# CHECK-INSTR: <movt_prel>:88# CHECK-INSTR: f2c0 0000 movt r0, #0x089# jitlink-check: decode_operand(movt_prel, 2) = (ext_func - movt_prel)[31:16]90 .globl movt_prel91 .type movt_prel,%function92 .p2align 193 .code 1694 .thumb_func95movt_prel:96 movt r0, :upper16:ext_func - .97 .size movt_prel, .-movt_prel98 99# Empty main function for jitlink to be happy100 .globl main101 .type main,%function102 .p2align 1103 .code 16104 .thumb_func105main:106 bx lr107 .size main, .-main108