1@ RUN: llvm-mc %s -triple=armv7-linux-gnueabi | FileCheck -check-prefix=ASM %s 2@ RUN: llvm-mc %s -triple=armv7-linux-gnueabi -filetype=obj -o %t.o 3@ RUN: llvm-objdump -d -r %t.o -triple=armv7-linux-gnueabi | FileCheck -check-prefix=OBJ %s 4@ RUN: llvm-mc %s -triple=thumbv7-linux-gnueabi -filetype=obj -o %t.o 5@ RUN: llvm-objdump -d -r %t.o -triple=thumbv7-linux-gnueabi | FileCheck -check-prefix=THUMB %s 6 7 .syntax unified 8 .text 9 .globl barf 10 .align 2 11 .type barf,%function 12barf: @ @barf 13@ %bb.0: @ %entry 14 movw r0, :lower16:GOT-(.LPC0_2+8) 15 movt r0, :upper16:GOT-(.LPC0_2+8) 16.LPC0_2: 17 movw r0, :lower16:extern_symbol+1234 18 movt r0, :upper16:extern_symbol+1234 19 20 movw r0, :lower16:(foo - bar + 1234) 21 movt r0, :upper16:(foo - bar + 1234) 22foo: 23bar: 24 25@ ASM: movw r0, :lower16:(GOT-(.LPC0_2+8)) 26@ ASM-NEXT: movt r0, :upper16:(GOT-(.LPC0_2+8)) 27@ ASM: movw r0, :lower16:(extern_symbol+1234) 28@ ASM-NEXT: movt r0, :upper16:(extern_symbol+1234) 29@ ASM: movw r0, :lower16:((foo-bar)+1234) 30@ ASM-NEXT: movt r0, :upper16:((foo-bar)+1234) 31 32@OBJ: Disassembly of section .text: 33@OBJ-NEXT: barf: 34@OBJ-NEXT: 0: f0 0f 0f e3 movw r0, #65520 35@OBJ-NEXT: 00000000: R_ARM_MOVW_PREL_NC GOT 36@OBJ-NEXT: 4: f4 0f 4f e3 movt r0, #65524 37@OBJ-NEXT: 00000004: R_ARM_MOVT_PREL GOT 38@OBJ-NEXT: 8: d2 04 00 e3 movw r0, #1234 39@OBJ-NEXT: 00000008: R_ARM_MOVW_ABS_NC extern_symbol 40@OBJ-NEXT: c: d2 04 40 e3 movt r0, #1234 41@OBJ-NEXT: 0000000c: R_ARM_MOVT_ABS extern_symbol 42@OBJ-NEXT: 10: d2 04 00 e3 movw r0, #1234 43@OBJ-NEXT: 14: 00 00 40 e3 movt r0, #0 44 45@THUMB: Disassembly of section .text: 46@THUMB-NEXT: barf: 47@THUMB-NEXT: 0: 4f f6 f0 70 movw r0, #65520 48@THUMB-NEXT: 00000000: R_ARM_THM_MOVW_PREL_NC GOT 49@THUMB-NEXT: 4: cf f6 f4 70 movt r0, #65524 50@THUMB-NEXT: 00000004: R_ARM_THM_MOVT_PREL GOT 51@THUMB-NEXT: 8: 40 f2 d2 40 movw r0, #1234 52@THUMB-NEXT: 00000008: R_ARM_THM_MOVW_ABS_NC extern_symbol 53@THUMB-NEXT: c: c0 f2 d2 40 movt r0, #1234 54@THUMB-NEXT: 0000000c: R_ARM_THM_MOVT_ABS extern_symbol 55@THUMB-NEXT: 10: 40 f2 d2 40 movw r0, #1234 56@THUMB-NEXT: 14: c0 f2 00 00 movt r0, #0 57