54 lines · plain
1# REQUIRES: hexagon2# RUN: rm -rf %t && split-file %s %t3# RUN: llvm-mc -filetype=obj -triple=hexagon-unknown-elf %t/a.s -o %t/a.o4# RUN: ld.lld -T %t/lds %t/a.o -o %t/a5# RUN: llvm-objdump -d --no-show-raw-insn %t/a 2>&1 | \6# RUN: FileCheck --check-prefixes=CHECK-NONPIC,CHECK %s7# RUN: llvm-mc -filetype=obj \8# RUN: -triple=hexagon-unknown-elf %t/a.s -o %t/a.o9 10# RUN: ld.lld -T %t/lds --pie %t/a.o -o %t/a11# RUN: llvm-objdump -d --no-show-raw-insn %t/a 2>&1 | \12# RUN: FileCheck --check-prefixes=CHECK-PIC,CHECK %s13 14#--- a.s15.section .text_low, "ax", %progbits16 .globl main17 .type main, @function18main:19 call myfn20 jumpr r3121 .size main, .-main22 23.section .text_high, "ax", %progbits24 .globl myfn25 .type myfn, @function26myfn:27 jumpr r3128 .size myfn, .-myfn29 30# CHECK: Disassembly of section .text_low:31 32# CHECK: <__hexagon_thunk_myfn_from_.text.thunk>:33# CHECK-NONPIC-NEXT: 200b4: { immext(#0x1000000)34# CHECK-NONPIC-NEXT: jump 0x10200bc <myfn> }35# CHECK-PIC-NEXT: 200b4: { immext(#0x1000000)36# CHECK-PIC-NEXT: r14 = add(pc,##0x1000008) }37# CHECK-PIC-NEXT: { jumpr r14 }38 39# CHECK-NONPIC: <main>:40# CHECK-NONPIC-NEXT: 200bc: { call 0x200b4 <__hexagon_thunk_myfn_from_.text.thunk> }41# CHECK-PIC: <main>:42# CHECK-PIC-NEXT: 200c0: { call 0x200b4 <__hexagon_thunk_myfn_from_.text.thunk> }43# CHECK-NEXT: { jumpr r31 }44 45# CHECK: Disassembly of section .text_high:46# CHECK: <myfn>:47# CHECK-NEXT: 10200bc: { jumpr r31 }48 49#--- lds50SECTIONS {51 .text_low 0x200b4: { *(.text_low) }52 .text_high 0x10200bc : { *(.text_high) }53}54