1@ RUN: llvm-mc -triple armv7-unknown-unknown %s --show-encoding > %t
2@ RUN: FileCheck < %t %s
3@ RUN: llvm-mc -triple armebv7-unknown-unknown %s --show-encoding > %t
4@ RUN: FileCheck --check-prefix=CHECK-BE < %t %s
5
6    bl _printf
7@ CHECK: bl _printf @ encoding: [A,A,A,0xeb]
8@ CHECK: @ fixup A - offset: 0, value: _printf, kind: fixup_arm_uncondbl
9@ CHECK-BE: bl _printf @ encoding: [0xeb,A,A,A]
10@ CHECK-BE: @ fixup A - offset: 0, value: _printf, kind: fixup_arm_uncondbl
11
12    mov r9, :lower16:(_foo)
13    movw r9, :lower16:(_foo)
14    movt r9, :upper16:(_foo)
15
16@ CHECK: movw	r9, :lower16:_foo       @ encoding: [A,0x90'A',0b0000AAAA,0xe3]
17@ CHECK: @   fixup A - offset: 0, value: _foo, kind: fixup_arm_movw_lo16
18@ CHECK-BE: movw	r9, :lower16:_foo       @ encoding: [0xe3,0b0000AAAA,0x90'A',A]
19@ CHECK-BE: @   fixup A - offset: 0, value: _foo, kind: fixup_arm_movw_lo16
20@ CHECK: movw	r9, :lower16:_foo       @ encoding: [A,0x90'A',0b0000AAAA,0xe3]
21@ CHECK: @   fixup A - offset: 0, value: _foo, kind: fixup_arm_movw_lo16
22@ CHECK-BE: movw	r9, :lower16:_foo       @ encoding: [0xe3,0b0000AAAA,0x90'A',A]
23@ CHECK-BE: @   fixup A - offset: 0, value: _foo, kind: fixup_arm_movw_lo16
24@ CHECK: movt	r9, :upper16:_foo       @ encoding: [A,0x90'A',0b0100AAAA,0xe3]
25@ CHECK: @   fixup A - offset: 0, value: _foo, kind: fixup_arm_movt_hi16
26@ CHECK-BE: movt	r9, :upper16:_foo       @ encoding: [0xe3,0b0100AAAA,0x90'A',A]
27@ CHECK-BE: @   fixup A - offset: 0, value: _foo, kind: fixup_arm_movt_hi16
28
29    mov r2, :lower16:fred
30
31@ CHECK: movw  r2, :lower16:fred                 @ encoding: [A,0x20'A',0b0000AAAA,0xe3]
32@ CHECK: @   fixup A - offset: 0, value: fred, kind: fixup_arm_movw_lo16
33@ CHECK-BE: movw  r2, :lower16:fred                 @ encoding: [0xe3,0b0000AAAA,0x20'A',A]
34@ CHECK-BE: @   fixup A - offset: 0, value: fred, kind: fixup_arm_movw_lo16
35
36    add r0, r0, #(L1 - L2)
37
38@ CHECK: add     r0, r0, #L1-L2          @ encoding: [A,0b0000AAAA,0x80,0xe2]
39@ CHECK: @   fixup A - offset: 0, value: L1-L2, kind: fixup_arm_mod_imm
40@ CHECK-BE: add     r0, r0, #L1-L2          @ encoding: [0xe2,0x80,0b0000AAAA,A]
41@ CHECK-BE: @   fixup A - offset: 0, value: L1-L2, kind: fixup_arm_mod_imm
42