1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
; RUN: llvm-mc -triple=m68k --mcpu=M68020 -motorola-integers -filetype=obj --position-independent < %s \
; RUN: | llvm-objdump -d - | FileCheck %s
; RUN: llvm-mc -triple m68k --mcpu=M68020 -show-encoding --position-independent %s -o - \
; RUN: | FileCheck -check-prefix=INSTR %s
; Branch relocations are relaxed as part of object layout, so -show-encoding still
; shows them as 1-byte relocactions
; CHECK-LABEL: <TIGHT>:
TIGHT:
; CHECK: bra $7f
; INSTR: bra .LBB0_2 ; encoding: [0x60,A]
bra .LBB0_2
.space 0x7F ; i8::MAX
.LBB0_2:
add.l #0, %d0
rts
; CHECK-LABEL: <RELAXED>:
RELAXED:
; CHECK: bra $82
; INSTR: bra .LBB1_2 ; encoding: [0x60,A]
bra .LBB1_2
.space 0x80 ; Greater than i8::MAX
.LBB1_2:
add.l #0, %d0
rts
; CHECK-LABEL: <RELAXED_32>:
RELAXED_32:
; CHECK: bra $ff
; CHECK-NEXT: 00 00
; CHECK-NEXT: 80 04
; INSTR: bra .LBB2_1 ; encoding: [0x60,A]
bra .LBB2_1
.space 0x8000 ; Greater than i16::MAX.
.LBB2_1:
add.l #0, %d0
rts
; CHECK-LABEL: <ZERO>:
ZERO:
; CHECK: bra $2
; INSTR: bra .LBB3_1 ; encoding: [0x60,A]
bra .LBB3_1
.LBB3_1:
add.l #0, %d0
rts
|