comparison lld/test/ELF/arm-thumb-blx.s @ 173:0572611fdcc8 llvm10 llvm12

reorgnization done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 11:55:54 +0900
parents 1d019706d866
children c4bab56944e8
comparison
equal deleted inserted replaced
172:9fbae9c8bf63 173:0572611fdcc8
6 // RUN: .R_ARM_CALL24_callee2 : { *(.R_ARM_CALL24_callee_thumb_low) } \ 6 // RUN: .R_ARM_CALL24_callee2 : { *(.R_ARM_CALL24_callee_thumb_low) } \
7 // RUN: .caller : { *(.text) } \ 7 // RUN: .caller : { *(.text) } \
8 // RUN: .R_ARM_CALL24_callee3 : { *(.R_ARM_CALL24_callee_high) } \ 8 // RUN: .R_ARM_CALL24_callee3 : { *(.R_ARM_CALL24_callee_high) } \
9 // RUN: .R_ARM_CALL24_callee4 : { *(.R_ARM_CALL24_callee_thumb_high) } } " > %t.script 9 // RUN: .R_ARM_CALL24_callee4 : { *(.R_ARM_CALL24_callee_thumb_high) } } " > %t.script
10 // RUN: ld.lld --script %t.script %t %ttarget -o %t2 10 // RUN: ld.lld --script %t.script %t %ttarget -o %t2
11 // RUN: llvm-objdump -d -triple=thumbv7a-none-linux-gnueabi %t2 | FileCheck %s 11 // RUN: llvm-objdump -d --triple=thumbv7a-none-linux-gnueabi %t2 | FileCheck %s
12 // Test BLX instruction is chosen for Thumb BL/BLX instruction and ARM callee 12 // Test BLX instruction is chosen for Thumb BL/BLX instruction and ARM callee
13 // 2 byte nops are used to test the pc-rounding behaviour. As a BLX from a 13 // 2 byte nops are used to test the pc-rounding behaviour. As a BLX from a
14 // 2 byte aligned destination is defined as Align(PC,4) + immediate:00 14 // 2 byte aligned destination is defined as Align(PC,4) + immediate:00
15 // FIXME: llvm-mc has problems assembling BLX unless the destination is 15 // FIXME: llvm-mc has problems assembling BLX unless the destination is
16 // external. The targets of the BL and BLX instructions are in arm-thumb-blx-target.s 16 // external. The targets of the BL and BLX instructions are in arm-thumb-blx-target.s
49 // CHECK-NEXT-THUMB: callee_thumb_low: 49 // CHECK-NEXT-THUMB: callee_thumb_low:
50 // CHECK-NEXT-THUMB: 100: 70 47 bx lr 50 // CHECK-NEXT-THUMB: 100: 70 47 bx lr
51 51
52 // CHECK: Disassembly of section .caller: 52 // CHECK: Disassembly of section .caller:
53 // CHECK-EMPTY: 53 // CHECK-EMPTY:
54 // CHECK: _start: 54 // CHECK: <_start>:
55 // Align(0x10000,4) - 0xff50 (65360) + 4 = 0xb4 = callee_low 55 // Align(0x10000,4) - 0xff50 (65360) + 4 = 0xb4 = callee_low
56 // CHECK-NEXT-THUMB: 10000: f0 f7 58 e8 blx #-65360 56 // CHECK-NEXT-THUMB: 10000: f0 f7 58 e8 blx #-65360
57 // CHECK-NEXT-THUMB: 10004: 00 bf nop 57 // CHECK-NEXT-THUMB: 10004: 00 bf nop
58 // Align(0x10006,4) - 0xff54 (65364) + 4 = 0xb4 = callee_low 58 // Align(0x10006,4) - 0xff54 (65364) + 4 = 0xb4 = callee_low
59 // CHECK-NEXT-THUMB: 10006: f0 f7 56 e8 blx #-65364 59 // CHECK-NEXT-THUMB: 10006: f0 f7 56 e8 blx #-65364