Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / ARM / elf-movt.s
blob72dad26d0666445f003906e04d88b30eaa6c2392
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 --no-print-imm-hex -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 --no-print-imm-hex -d -r %t.o --triple=thumbv7-linux-gnueabi | FileCheck --check-prefix=THUMB %s
7 .syntax unified
8 .text
9 .globl barf
10 .align 2
11 .type barf,%function
12 barf: @ @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
20 movw r0, :lower16:(foo - bar + 1234)
21 movt r0, :upper16:(foo - bar + 1234)
22 foo:
23 bar:
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)
32 @OBJ: Disassembly of section .text:
33 @OBJ-EMPTY:
34 @OBJ-NEXT: <barf>:
35 @OBJ-NEXT: 0: e30f0ff0 movw r0, #65520
36 @OBJ-NEXT: 00000000: R_ARM_MOVW_PREL_NC GOT
37 @OBJ-NEXT: 4: e34f0ff4 movt r0, #65524
38 @OBJ-NEXT: 00000004: R_ARM_MOVT_PREL GOT
39 @OBJ-NEXT: 8: e30004d2 movw r0, #1234
40 @OBJ-NEXT: 00000008: R_ARM_MOVW_ABS_NC extern_symbol
41 @OBJ-NEXT: c: e34004d2 movt r0, #1234
42 @OBJ-NEXT: 0000000c: R_ARM_MOVT_ABS extern_symbol
43 @OBJ-NEXT: 10: e30004d2 movw r0, #1234
44 @OBJ-NEXT: 14: e3400000 movt r0, #0
46 @THUMB: Disassembly of section .text:
47 @THUMB-EMPTY:
48 @THUMB-NEXT: <barf>:
49 @THUMB-NEXT: 0: f64f 70f0 movw r0, #65520
50 @THUMB-NEXT: 00000000: R_ARM_THM_MOVW_PREL_NC GOT
51 @THUMB-NEXT: 4: f6cf 70f4 movt r0, #65524
52 @THUMB-NEXT: 00000004: R_ARM_THM_MOVT_PREL GOT
53 @THUMB-NEXT: 8: f240 40d2 movw r0, #1234
54 @THUMB-NEXT: 00000008: R_ARM_THM_MOVW_ABS_NC extern_symbol
55 @THUMB-NEXT: c: f2c0 40d2 movt r0, #1234
56 @THUMB-NEXT: 0000000c: R_ARM_THM_MOVT_ABS extern_symbol
57 @THUMB-NEXT: 10: f240 40d2 movw r0, #1234
58 @THUMB-NEXT: 14: f2c0 0000 movt r0, #0