brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.0 KiB · 4722cd4 Raw
96 lines · plain
1// REQUIRES: arm2// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv5-none-linux-gnueabi %s -o %t3// RUN: ld.lld %t -o %t24// RUN: llvm-objdump --no-print-imm-hex -d %t2 --triple=armv5-none-linux-gnueabi | FileCheck %s5// RUN: ld.lld %t -o %t3 --shared6// RUN: llvm-objdump --no-print-imm-hex -d %t3 --triple=armv5-none-linux-gnueabi | FileCheck --check-prefix=CHECK-PI %s7 8// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv5eb-none-linux-gnueabi %s -o %t9// RUN: ld.lld %t -o %t210// RUN: llvm-objdump --no-print-imm-hex -d %t2 --triple=armv5eb-none-linux-gnueabi | FileCheck --check-prefix=CHECK-EB %s11// RUN: ld.lld %t -o %t3 --shared12// RUN: llvm-objdump --no-print-imm-hex -d %t3 --triple=armv5eb-none-linux-gnueabi | FileCheck --check-prefix=CHECK-EB-PI %s13 14// Test ARM Thumb Interworking on older Arm architectures using Thunks that do15// not use MOVT/MOVW instructions.16// For pure interworking (not considering range extension) there is only the17// case of an Arm B to a Thumb Symbol to consider as in older Arm architectures18// there is no Thumb B.w that we can intercept with a Thunk and we still assume19// support for the blx instruction for Thumb BL and BLX to an Arm symbol.20        .arm21        .text22        .syntax unified23        .cpu    arm10tdmi24 25        .text26        .globl _start27        .type _start, %function28        .balign 0x100029_start:30        b thumb_func31        bl thumb_func32        blx thumb_func33        bx lr34 35// CHECK: <_start>:36// CHECK-NEXT: 21000: ea000003        b       0x21014 <__ARMv5LongLdrPcThunk_thumb_func>37// CHECK-NEXT: 21004: fa000001        blx     0x21010 <thumb_func>38// CHECK-NEXT: 21008: fa000000        blx     0x21010 <thumb_func>39// CHECK-NEXT: 2100c: e12fff1e        bx      lr40 41// CHECK: <thumb_func>:42// CHECK-NEXT: 21010: 4770    bx      lr43 44// CHECK: <__ARMv5LongLdrPcThunk_thumb_func>:45// CHECK-NEXT: 21014: e51ff004        ldr     pc, [pc, #-4]46// CHECK-NEXT: 21018: 11 10 02 00     .word   0x0002101147 48// CHECK-EB: <_start>:49// CHECK-EB-NEXT: 21000: ea000003        b       0x21014 <__ARMv5LongLdrPcThunk_thumb_func>50// CHECK-EB-NEXT: 21004: fa000001        blx     0x21010 <thumb_func>51// CHECK-EB-NEXT: 21008: fa000000        blx     0x21010 <thumb_func>52// CHECK-EB-NEXT: 2100c: e12fff1e        bx      lr53 54// CHECK-EB: <thumb_func>:55// CHECK-EB-NEXT: 21010: 4770    bx      lr56 57// CHECK-EB: <__ARMv5LongLdrPcThunk_thumb_func>:58// CHECK-EB-NEXT: 21014: e51ff004        ldr     pc, [pc, #-4]59// CHECK-EB-NEXT: 21018: 00 02 10 11     .word   0x0002101160 61// CHECK-PI: <_start>:62// CHECK-PI-NEXT: 11000: ea000003        b       0x11014 <__ARMv4PILongBXThunk_thumb_func>63// CHECK-PI-NEXT: 11004: fa000001        blx     0x11010 <thumb_func>64// CHECK-PI-NEXT: 11008: fa000000        blx     0x11010 <thumb_func>65// CHECK-PI-NEXT: 1100c: e12fff1e        bx      lr66 67// CHECK-PI: <thumb_func>:68// CHECK-PI-NEXT: 11010: 4770    bx      lr69 70// CHECK-PI: <__ARMv4PILongBXThunk_thumb_func>:71// CHECK-PI-NEXT: 11014: e59fc004        ldr     r12, [pc, #4]72// CHECK-PI-NEXT: 11018: e08fc00c        add     r12, pc, r1273// CHECK-PI-NEXT: 1101c: e12fff1c        bx      r1274// CHECK-PI-NEXT: 11020: f1 ff ff ff     .word   0xfffffff175 76// CHECK-EB-PI: <_start>:77// CHECK-EB-PI-NEXT: 11000: ea000003        b       0x11014 <__ARMv4PILongBXThunk_thumb_func>78// CHECK-EB-PI-NEXT: 11004: fa000001        blx     0x11010 <thumb_func>79// CHECK-EB-PI-NEXT: 11008: fa000000        blx     0x11010 <thumb_func>80// CHECK-EB-PI-NEXT: 1100c: e12fff1e        bx      lr81 82// CHECK-EB-PI: <thumb_func>:83// CHECK-EB-PI-NEXT: 11010: 4770    bx      lr84 85// CHECK-EB-PI: <__ARMv4PILongBXThunk_thumb_func>:86// CHECK-EB-PI-NEXT: 11014: e59fc004        ldr     r12, [pc, #4]87// CHECK-EB-PI-NEXT: 11018: e08fc00c        add     r12, pc, r1288// CHECK-EB-PI-NEXT: 1101c: e12fff1c        bx      r1289// CHECK-EB-PI-NEXT: 11020: ff ff ff f1     .word   0xfffffff190        .section .text.1, "ax", %progbits91        .thumb92        .hidden thumb_func93        .type thumb_func, %function94thumb_func:95        bx lr96