[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / arm-thumb-alu.s
blobd68900edc5c0299fc01b31624e4561f499c4926c
1 // REQUIRES: arm
3 // RUN: split-file %s %t
4 // RUN: llvm-mc -filetype=obj -triple=thumbv6m-unknown-linux-gnueabi %t/asm -o %t.o
5 // RUN: ld.lld --script %t/lds %t.o -o %t2
6 // RUN: llvm-objdump -d %t2 --triple=thumbv6m-unknown-linux-gnueabi --no-show-raw-insn | FileCheck %s
8 //--- lds
9 SECTIONS {
10 .tests 0x00001000 : AT(0x00001000) { *(.tests) }
11 .sym1 0x11223344 : AT(0x11223344) { *(.sym1) }
12 .sym2 0x00ffffff : AT(0x00ffffff) { *(.sym2) }
13 .fn 0x55667788 : AT(0x55667788) { *(.fn) }
16 //--- asm
17 .section .tests, "ax", %progbits
19 // CHECK-LABEL: <R_ARM_THM_ALU_ABS_G0_NC>:
20 // CHECK: adds r0, #0x44
21 // CHECK-NEXT: movs r0, #0x44
22 // CHECK-NEXT: movs r0, #0x45
23 // CHECK-NEXT: movs r0, #0x43
24 // CHECK-NEXT: movs r0, #0xff
25 // CHECK-NEXT: movs r0, #0x0
26 // CHECK-NEXT: movs r0, #0xfe
27 // CHECK-NEXT: movs r0, #0x89
28 // CHECK-NEXT: movs r0, #0x8b
29 R_ARM_THM_ALU_ABS_G0_NC:
30 adds r0, :lower0_7:sym1
31 movs r0, :lower0_7:sym1
32 movs r0, :lower0_7:sym1+1
33 movs r0, :lower0_7:sym1+0xff
34 movs r0, :lower0_7:sym2
35 movs r0, :lower0_7:sym2+1
36 movs r0, :lower0_7:sym2+0xff
37 movs r0, :lower0_7:fn
38 movs r0, :lower0_7:fn+2
40 // CHECK-LABEL: <R_ARM_THM_ALU_ABS_G1_NC>:
41 // CHECK: adds r0, #0x33
42 // CHECK-NEXT: movs r0, #0x33
43 // CHECK-NEXT: movs r0, #0x33
44 // CHECK-NEXT: movs r0, #0x34
45 // CHECK-NEXT: movs r0, #0xff
46 // CHECK-NEXT: movs r0, #0x0
47 // CHECK-NEXT: movs r0, #0x0
48 // CHECK-NEXT: movs r0, #0x77
49 // CHECK-NEXT: movs r0, #0x77
50 R_ARM_THM_ALU_ABS_G1_NC:
51 adds r0, :lower8_15:sym1
52 movs r0, :lower8_15:sym1
53 movs r0, :lower8_15:sym1+1
54 movs r0, :lower8_15:sym1+0xff
55 movs r0, :lower8_15:sym2
56 movs r0, :lower8_15:sym2+1
57 movs r0, :lower8_15:sym2+0xff
58 movs r0, :lower8_15:fn
59 movs r0, :lower8_15:fn+2
61 // CHECK-LABEL: <R_ARM_THM_ALU_ABS_G2_NC>:
62 // CHECK: adds r0, #0x22
63 // CHECK-NEXT: movs r0, #0x22
64 // CHECK-NEXT: movs r0, #0x22
65 // CHECK-NEXT: movs r0, #0x22
66 // CHECK-NEXT: movs r0, #0xff
67 // CHECK-NEXT: movs r0, #0x0
68 // CHECK-NEXT: movs r0, #0x0
69 // CHECK-NEXT: movs r0, #0x66
70 // CHECK-NEXT: movs r0, #0x66
71 R_ARM_THM_ALU_ABS_G2_NC:
72 adds r0, :upper0_7:sym1
73 movs r0, :upper0_7:sym1
74 movs r0, :upper0_7:sym1+1
75 movs r0, :upper0_7:sym1+0xff
76 movs r0, :upper0_7:sym2
77 movs r0, :upper0_7:sym2+1
78 movs r0, :upper0_7:sym2+0xff
79 movs r0, :upper0_7:fn
80 movs r0, :upper0_7:fn+2
82 // CHECK-LABEL: <R_ARM_THM_ALU_ABS_G3>:
83 // CHECK: adds r0, #0x11
84 // CHECK-NEXT: movs r0, #0x11
85 // CHECK-NEXT: movs r0, #0x11
86 // CHECK-NEXT: movs r0, #0x11
87 // CHECK-NEXT: movs r0, #0x0
88 // CHECK-NEXT: movs r0, #0x1
89 // CHECK-NEXT: movs r0, #0x1
90 // CHECK-NEXT: movs r0, #0x55
91 // CHECK-NEXT: movs r0, #0x55
92 R_ARM_THM_ALU_ABS_G3:
93 adds r0, :upper8_15:sym1
94 movs r0, :upper8_15:sym1
95 movs r0, :upper8_15:sym1+1
96 movs r0, :upper8_15:sym1+0xff
97 movs r0, :upper8_15:sym2
98 movs r0, :upper8_15:sym2+1
99 movs r0, :upper8_15:sym2+0xff
100 movs r0, :upper8_15:fn
101 movs r0, :upper8_15:fn+2
103 .section .sym1, "aw", %progbits
104 sym1:
105 .byte 0
107 .section .sym2, "aw", %progbits
108 sym2:
109 .byte 0
111 .section .fn, "ax", %progbits
112 .thumb_func
114 bx lr