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