Files
clang-p2996/llvm/test/CodeGen/M68k/Encoding/Control/call-pc-rel.mir
Min-Yih Hsu c23a780c30 [M68k][test](6/8) Add all of the tests
And a small utilities -- extract-section.py -- that helps extracting
specific object file section and printing in textual format. This
utility is just a workaround for tests inside `Encoding`. Hopefully in
the future we can replace dependencies in those tests with existing tools
(e.g. llvm-readobj). Please refer to this bug for more context:
https://bugs.llvm.org/show_bug.cgi?id=49245

Note that since we don't have AsmParser for now, we are testing the MC
part using MIR as input and put those tests under the `Encoding` folder.
In the future when AsmParser (and disassembler) is finished, those tests
will be moved to `test/MC/M68k`.

Authors: myhsu, m4yers, glaubitz

Differential Revision: https://reviews.llvm.org/D88392
2021-03-08 12:30:57 -08:00

67 lines
1.2 KiB
YAML

# RUN: llc %s -mtriple=m68k -start-after=prologepilog -O0 -filetype=obj \
# RUN: -code-model=small -relocation-model=pic -o - \
# RUN: | extract-section .text -h \
# RUN: | FileCheck %s
#------------------------------------------------------------------------------
# Tests PC-Relative Calls' offsets. The rest requires relocation and tested
# appropriately elsewhere.
#------------------------------------------------------------------------------
#
# <BACKWARD>
# 00 CHECK: 4e71
# 02 CHECK-SAME: 4e75
#
# <PCI>
# 04 CHECK-SAME: 4ebb 08fa
# 08 CHECK-SAME: 4ebb 080a
#
# <PCD>
# 0c CHECK-SAME: 4eba fff2
# 10 CHECK-SAME: 4eba 0002
#
# <FORWARD>
# 14 CHECK-SAME: 4e71
# 16 CHECK-SAME: 4e75
--- |
define dso_local void @BACKWARD() { entry: ret void }
define dso_local void @PCI() { entry: ret void }
define dso_local void @PCD() { entry: ret void }
define dso_local void @FORWARD() { entry: ret void }
...
--- # BACKWARD
name: BACKWARD
body: |
bb.0:
NOP
RTS
...
--- # PCI
name: PCI
body: |
bb.0:
CALLk @BACKWARD, $d0
CALLk @FORWARD, $d0
...
--- # PCD
name: PCD
body: |
bb.0:
CALLq @BACKWARD
CALLq @FORWARD
...
--- # FORWARD
name: FORWARD
body: |
bb.0:
NOP
RTS
...