2 # RUN: llvm-mc -filetype=obj -triple=hexagon-unknown-elf %s -o %t.o
3 # RUN: llvm-mc -filetype=obj -triple=hexagon-unknown-elf %S/Inputs/hexagon.s -o %t1.o
4 # RUN: ld.lld %t.o %t1.o -o %t
5 # RUN: llvm-objdump --no-print-imm-hex -d %t | FileCheck %s
7 # Note: 131584 == 0x20200
11 # CHECK: immext(#131584)
12 # CHECK: if (p0) r0 = ##131644
15 if
(p0
) jump
:nt
#_start
16 # CHECK: if (p0) jump:nt 0x2023c
20 if
(p0
) jump
:nt
##_start
21 # CHECK: if (p0) jump:nt 0x2023c
34 # One test for each mask in the lookup table.
37 if
(!P0
) memw
(r0+
#8)=##_start
38 # CHECK: 38c0e11c if (!p0) memw(r0+#8) = ##131644 }
42 if
(!P0.new
) memw
(r0+
#0)=##_start }
43 # CHECK: 39c0e01c if (!p0.new) memw(r0+#0) = ##131644 }
47 # CHECK: 3e40de01 memw(r0+##131644) += r1 }
51 # CHECK: 3f40de04 memw(r0+##131644) += #4 }
55 if
(p0
) memb
(r0+
##_start)=r0.new }
56 # CHECK: 40a0e2e0 if (p0) memb(r0+##131644) = r0.new }
59 if
(p0
) r0=memb
(r1+
##_start)
60 # CHECK: 4101c780 if (p0) r0 = memb(r1+##131644) }
65 if
(p0.new
) memb
(r0+
##_start)=r0.new }
66 # CHECK: 42a0e2e0 if (p0.new) memb(r0+##131644) = r0.new }
70 if
(P0.new
) r0=memb
(r0+
##_start) }
71 # CHECK: 4300c780 if (p0.new) r0 = memb(r0+##131644) }
74 if
(!p0
) memb
(r0+
##_start)=r1
75 # CHECK: 4400e1e0 if (!p0) memb(r0+##131644) = r1 }
78 if
(!p0
) r0=memb
(r1+
##_start)
79 # CHECK: 4501c780 if (!p0) r0 = memb(r1+##131644) }
83 if
(!p0.new
) memb
(r0+
##_start)=r1 }
84 # CHECK: 4600e1e0 if (!p0.new) memb(r0+##131644) = r1 }
88 if
(!p0.new
) r0=memb
(r1+
##_start) }
89 # CHECK: 4701c780 if (!p0.new) r0 = memb(r1+##131644) }
91 #0x6a000000 -- Note 4294967132 == -0xa4 the distance between
92 # here and _start, so this will change if
93 # tests are added between here and _start
94 r0=add(pc
,##_start@pcrel)
95 # CHECK: 6a49d600 r0 = add(pc,##236) }
98 r1:0=combine
(#8,##_start)
99 # CHECK: 7c9ec100 r1:0 = combine(#8,##131644) }
102 r1:0=memb_fifo
(r2=##_start)
103 # CHECK: 9a82df00 r1:0 = memb_fifo(r2=##131644) }
107 # CHECK: 9b01df00 r0 = memb(r1=##131644) }
110 r1:0=memb_fifo
(r2<<#2+##_start)
111 # CHECK: 9c82ff00 r1:0 = memb_fifo(r2<<#2+##131644) }
114 r0=memb
(r1<<#2+##_start)
115 # CHECK: 9d01ff00 r0 = memb(r1<<#2+##131644) }
118 if
(!p0
) r0=memb
(##_start)
119 # CHECK: 9f1ee880 if (!p0) r0 = memb(##131644) }
123 # CHECK: ab00c1bc memb(r0=##131644) = r1 }
126 memb
(r0<<#2+##_start)=r1
127 # CHECK: ad00e1bc memb(r0<<#2+##131644) = r1 }
130 if
(!p0
) memb
(##_start)=r1
131 # CHECK: af03c1e4 if (!p0) memb(##131644) = r1 }
134 r0=add(##_start,mpyi(r1,r2))
135 # CHECK: d761e280 r0 = add(##131644,mpyi(r1,r2)) }
138 R0=add(##_start,mpyi(r0,#2))
139 # CHECK: d860e082 r0 = add(##131644,mpyi(r0,#2)) }
142 r0=add(r1,add(r2,##_start))
143 # CHECK: db61e082 r0 = add(r1,add(r2,##131644)) }
146 r0=add(r1,mpyi
(r2,##_start))
147 # CHECK: dfe2e081 r0 = add(r1,mpyi(r2,##131644)) }
149 # Duplex form of R_HEX_6_X
152 { r0 = ##_start; r2 = r16 }
153 # CHECK: 2bc03082 r0 = ##131644; r2 = r16 }
163 # R_HEX_8_X has 3 relocation mask variations
165 r0=sub(##_start, asl(r0, #1))
166 # CHECK: de20e1c6 r0 = sub(##131644,asl(r0,#1)) }
169 memw
(r0+
#0) = ##_start
170 # CHECK: 3c40c03c memw(r0+#0) = ##131644 }
173 r1:0=combine
(r2,##_start);
174 # CHECK: 7302e780 r1:0 = combine(r2,##131644) }
181 # R_HEX_16_X has 4 relocation mask variations
184 # CHECK: 4880c03c memw(##131644) = r0 }
188 # CHECK: 4980c780 r0 = memw(##131644)
192 # CHECK: 7800c780 r0 = ##131644 }
195 r0 = add(r1, ##_start)
196 # CHECK: b001c780 r0 = add(r1,##131644) }
199 {r0=#1 ; jump #_start}
200 # CHECK: jump 0x2023c
203 {r0=#1 ; jump ##_start}
204 # CHECK: jump 0x2023c
207 if
(r0 == #0) jump:t #_start
208 # CHECK: if (r0==#0) jump:t 0x2023c
211 p0
= !cmp.gtu
(r0, ##_start)
212 # CHECK: p0 = !cmp.gtu(r0,##131644)
215 p0
= !cmp.gt
(r0, ##_start)
216 # CHECK: p0 = !cmp.gt(r0,##131644)
219 r0 = memw
(r1+
##_start)
220 # CHECK: r0 = memw(r1+##131644)
222 memw
(r0+
##_start) = r1
223 # CHECK: memw(r0+##131644) = r1