mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
8009754517
A 32-bit immediate value can be formed from a constant expression and loaded into a register. Add support to emit this into an object file. Because this value is a constant, a relocation must *not* be produced for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199023 91177308-0d34-0410-b5e6-96231b3b80d8
81 lines
2.2 KiB
ArmAsm
81 lines
2.2 KiB
ArmAsm
@ RUN: llvm-mc -triple armv7-eabi -filetype asm -o - %s | FileCheck %s
|
|
@ RUN: llvm-mc -triple armv7-eabi -filetype obj -o - %s | llvm-readobj -r \
|
|
@ RUN: | FileCheck -check-prefix CHECK-RELOCATIONS %s
|
|
|
|
.syntax unified
|
|
|
|
.type function,%function
|
|
function:
|
|
bx lr
|
|
|
|
.global external
|
|
.type external,%function
|
|
|
|
.set deadbeat, 0xdeadbea7
|
|
|
|
.type test,%function
|
|
test:
|
|
movw r0, :lower16:function
|
|
movt r0, :upper16:function
|
|
|
|
movw r1, #:lower16:function
|
|
movt r1, #:upper16:function
|
|
|
|
movw r2, :lower16:deadbeat
|
|
movt r2, :upper16:deadbeat
|
|
|
|
movw r3, #:lower16:deadbeat
|
|
movt r3, #:upper16:deadbeat
|
|
|
|
movw r4, :lower16:0xD1510D6E
|
|
movt r4, :upper16:0xD1510D6E
|
|
|
|
movw r5, #:lower16:0xD1510D6E
|
|
movt r5, #:upper16:0xD1510D6E
|
|
|
|
movw r0, :lower16:external
|
|
movt r0, :upper16:external
|
|
|
|
movw r1, #:lower16:external
|
|
movt r1, #:upper16:external
|
|
|
|
movw r2, #:lower16:(16 + 16)
|
|
movt r2, #:upper16:(16 + 16)
|
|
|
|
movw r3, :lower16:(16 + 16)
|
|
movt r3, :upper16:(16 + 16)
|
|
|
|
@ CHECK-LABEL: test:
|
|
@ CHECK: movw r0, :lower16:function
|
|
@ CHECK: movt r0, :upper16:function
|
|
@ CHECK: movw r1, :lower16:function
|
|
@ CHECK: movt r1, :upper16:function
|
|
@ CHECK: movw r2, :lower16:(3735928487)
|
|
@ CHECK: movt r2, :upper16:(3735928487)
|
|
@ CHECK: movw r3, :lower16:(3735928487)
|
|
@ CHECK: movt r3, :upper16:(3735928487)
|
|
@ CHECK: movw r4, :lower16:(3511749998)
|
|
@ CHECK: movt r4, :upper16:(3511749998)
|
|
@ CHECK: movw r5, :lower16:(3511749998)
|
|
@ CHECK: movt r5, :upper16:(3511749998)
|
|
@ CHECK: movw r0, :lower16:external
|
|
@ CHECK: movt r0, :upper16:external
|
|
@ CHECK: movw r1, :lower16:external
|
|
@ CHECK: movt r1, :upper16:external
|
|
@ CHECK: movw r2, :lower16:(32)
|
|
@ CHECK: movt r2, :upper16:(32)
|
|
@ CHECK: movw r3, :lower16:(32)
|
|
@ CHECK: movt r3, :upper16:(32)
|
|
|
|
@ CHECK-RELOCATIONS: Relocations [
|
|
@ CHECK-RELOCATIONS: 0x4 R_ARM_MOVW_ABS_NC function 0x0
|
|
@ CHECK-RELOCATIONS: 0x8 R_ARM_MOVT_ABS function 0x0
|
|
@ CHECK-RELOCATIONS: 0xC R_ARM_MOVW_ABS_NC function 0x0
|
|
@ CHECK-RELOCATIONS: 0x10 R_ARM_MOVT_ABS function 0x0
|
|
@ CHECK-RELOCATIONS: 0x34 R_ARM_MOVW_ABS_NC external 0x0
|
|
@ CHECK-RELOCATIONS: 0x38 R_ARM_MOVT_ABS external 0x0
|
|
@ CHECK-RELOCATIONS: 0x3C R_ARM_MOVW_ABS_NC external 0x0
|
|
@ CHECK-RELOCATIONS: 0x40 R_ARM_MOVT_ABS external 0x0
|
|
@ CHECK-RELOCATIONS: ]
|
|
|