1@ RUN: llvm-mc -triple armv7-eabi -filetype asm -o - %s | FileCheck %s 2@ RUN: llvm-mc -triple armv7-eabi -filetype obj -o - %s | llvm-readobj -r \ 3@ RUN: | FileCheck -check-prefix CHECK-RELOCATIONS %s 4 5 .syntax unified 6 7 .type function,%function 8function: 9 bx lr 10 11 .global external 12 .type external,%function 13 14.set deadbeat, 0xdeadbea7 15 16 .type test,%function 17test: 18 movw r0, :lower16:function 19 movt r0, :upper16:function 20 21 movw r1, #:lower16:function 22 movt r1, #:upper16:function 23 24 movw r2, :lower16:deadbeat 25 movt r2, :upper16:deadbeat 26 27 movw r3, #:lower16:deadbeat 28 movt r3, #:upper16:deadbeat 29 30 movw r4, :lower16:0xD1510D6E 31 movt r4, :upper16:0xD1510D6E 32 33 movw r5, #:lower16:0xD1510D6E 34 movt r5, #:upper16:0xD1510D6E 35 36 movw r0, :lower16:external 37 movt r0, :upper16:external 38 39 movw r1, #:lower16:external 40 movt r1, #:upper16:external 41 42 movw r2, #:lower16:(16 + 16) 43 movt r2, #:upper16:(16 + 16) 44 45 movw r3, :lower16:(16 + 16) 46 movt r3, :upper16:(16 + 16) 47 48@ CHECK-LABEL: test: 49@ CHECK: movw r0, :lower16:function 50@ CHECK: movt r0, :upper16:function 51@ CHECK: movw r1, :lower16:function 52@ CHECK: movt r1, :upper16:function 53@ CHECK: movw r2, :lower16:(3735928487) 54@ CHECK: movt r2, :upper16:(3735928487) 55@ CHECK: movw r3, :lower16:(3735928487) 56@ CHECK: movt r3, :upper16:(3735928487) 57@ CHECK: movw r4, :lower16:(3511749998) 58@ CHECK: movt r4, :upper16:(3511749998) 59@ CHECK: movw r5, :lower16:(3511749998) 60@ CHECK: movt r5, :upper16:(3511749998) 61@ CHECK: movw r0, :lower16:external 62@ CHECK: movt r0, :upper16:external 63@ CHECK: movw r1, :lower16:external 64@ CHECK: movt r1, :upper16:external 65@ CHECK: movw r2, :lower16:(32) 66@ CHECK: movt r2, :upper16:(32) 67@ CHECK: movw r3, :lower16:(32) 68@ CHECK: movt r3, :upper16:(32) 69 70@ CHECK-RELOCATIONS: Relocations [ 71@ CHECK-RELOCATIONS: 0x4 R_ARM_MOVW_ABS_NC function 0x0 72@ CHECK-RELOCATIONS: 0x8 R_ARM_MOVT_ABS function 0x0 73@ CHECK-RELOCATIONS: 0xC R_ARM_MOVW_ABS_NC function 0x0 74@ CHECK-RELOCATIONS: 0x10 R_ARM_MOVT_ABS function 0x0 75@ CHECK-RELOCATIONS: 0x34 R_ARM_MOVW_ABS_NC external 0x0 76@ CHECK-RELOCATIONS: 0x38 R_ARM_MOVT_ABS external 0x0 77@ CHECK-RELOCATIONS: 0x3C R_ARM_MOVW_ABS_NC external 0x0 78@ CHECK-RELOCATIONS: 0x40 R_ARM_MOVT_ABS external 0x0 79@ CHECK-RELOCATIONS: ] 80 81