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