1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/MC/ARM/big-endian-thumb2-fixup.s
Peter Smith d984735422 [ARM] Support fixup for Thumb2 modified immediate
This change adds a new fixup fixup_t2_so_imm for the t2_so_imm_asmoperand
"T2SOImm". The fixup permits code such as:
.L1:
 sub r3, r3, #.L2 - .L1
.L2:
to assemble in Thumb2 as well as in ARM state.
    
The operand predicate isT2SOImm() explicitly doesn't match expressions
containing :upper16: and :lower16: as expressions with these operators
must match the movt and movw instructions.
    
The test mov r0, foo2 in thumb2-diagnostics is moved to a new file as the
fixup delays the error message till after the assembler has quit due to
the other errors.
    
As the mov instruction shares the t2_so_imm_asmoperand mov instructions
with a non constant expression now match t2MOVi rather than t2MOVi16 so the
error message is slightly different.
    
Fixes PR28647

Differential Revision: https://reviews.llvm.org/D33492

llvm-svn: 304702
2017-06-05 09:37:12 +00:00

56 lines
1.2 KiB
ArmAsm

// RUN: llvm-mc -triple=thumbeb-eabi -mattr v7,vfp2 -filetype=obj < %s | llvm-objdump -s - | FileCheck %s
.syntax unified
.text
.align 2
@ARM::fixup_t2_movw_lo16
.section s_movw,"ax",%progbits
// CHECK-LABEL: Contents of section s_movw
// CHECK: 0000 f2400008
movw r0, :lower16:(some_label+8)
@ARM::fixup_t2_movt_hi16
.section s_movt,"ax",%progbits
// CHECK-LABEL: Contents of section s_movt
// CHECK: 0000 f6cf70fc
movt r0, :upper16:GOT-(movt_label)
movt_label:
@ARM::fixup_t2_uncondbranch
.section s_uncondbranch,"ax",%progbits
// CHECK-LABEL: Contents of section s_uncondbranch
// CHECK: 0000 f000b801 bf00
b.w uncond_label
nop
uncond_label:
@ARM::fixup_t2_condbranch
.section s_condbranch,"ax",%progbits
// CHECK-LABEL: Contents of section s_condbranch
// CHECK: 0000 f0008001 bf00
beq.w cond_label
nop
cond_label:
@ARM::fixup_t2_ldst_precel_12
.section s_ldst_precel_12,"ax",%progbits
ldr.w r0, ldst_precel_12_label
nop
nop
ldst_precel_12_label:
@ARM::fixup_t2_adr_pcrel_12
.section s_adr_pcrel_12,"ax",%progbits
adr.w r0, adr_pcrel_12_label
nop
nop
adr_pcrel_12_label:
@ARM::fixup_t2_so_imm
.section s_t2_so_imm,"ax",%progbits
// CHECK-LABEL: Contents of section s_t2_so_imm
// CHECK: 0000 f1033337
add r3, r3,val
.equ val,0x37373737