• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -triple mips-unknown-linux < %s -show-encoding \
2// RUN:     | FileCheck -check-prefixes=ENCBE,FIXUP %s
3// RUN: llvm-mc -triple mipsel-unknown-linux < %s -show-encoding \
4// RUN:     | FileCheck -check-prefixes=ENCLE,FIXUP %s
5// RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux < %s \
6// RUN:     | llvm-readobj -r | FileCheck -check-prefix=RELOC %s
7// RUN: llvm-mc -filetype=obj -triple mips-unknown-linux < %s \
8// RUN:     | llvm-readobj -sections -section-data \
9// RUN:     | FileCheck -check-prefix=DATA %s
10
11// Test that we produce the correct relocation.
12// FIXME: move more relocation only tests here.
13
14// Check prefixes:
15// RELOC - Check the relocation in the object.
16// FIXUP - Check the fixup on the instruction.
17// ENCBE - Check the big-endian encoding on the instruction.
18// ENCLE - Check the little-endian encoding on the instruction.
19// ????? - Placeholder. Relocation is defined but the way of generating it is
20//         unknown.
21// FIXME - Placeholder. Generation method is known but doesn't work.
22
23// RELOC-LABEL: .rel.text {
24// DATA-LABEL: Name: .text
25// DATA:       SectionData (
26
27// DATA-NEXT:  0000: 00000004 00000000 00000004 0C000000
28        .short foo                         // RELOC: R_MIPS_16 foo
29
30        .short bar                         // RELOC: R_MIPS_16 .data
31
32baz:    .long foo                          // RELOC: R_MIPS_32 foo
33
34        .long bar                          // RELOC: R_MIPS_32 .data
35
36                                           // ?????: R_MIPS_REL32 foo
37
38        jal foo                            // RELOC: R_MIPS_26 foo
39                                           // ENCBE: jal foo # encoding: [0b000011AA,A,A,A]
40                                           // ENCLE: jal foo # encoding: [A,A,A,0b000011AA]
41                                           // FIXUP: # fixup A - offset: 0, value: foo, kind: fixup_Mips_26
42
43// The nop from the jal is at 0x0010
44// DATA-NEXT:  0010: 00000000 0C000001 00000000 24620000
45        jal baz                            // RELOC: R_MIPS_26 .text
46                                           // ENCBE: jal baz # encoding: [0b000011AA,A,A,A]
47                                           // ENCLE: jal baz # encoding: [A,A,A,0b000011AA]
48                                           // FIXUP: # fixup A - offset: 0, value: baz, kind: fixup_Mips_26
49
50        addiu $2, $3, %hi(foo)             // RELOC: R_MIPS_HI16 foo
51                                           // ENCBE: addiu $2, $3, %hi(foo) # encoding: [0x24,0x62,A,A]
52                                           // ENCLE: addiu $2, $3, %hi(foo) # encoding: [A,A,0x62,0x24]
53                                           // FIXUP: # fixup A - offset: 0, value: %hi(foo), kind: fixup_Mips_HI16
54
55// DATA-NEXT:  0020: 24620000 24620000 24620004 24620000
56        addiu $2, $3, %lo(foo)             // RELOC: R_MIPS_LO16 foo
57                                           // ENCBE: addiu $2, $3, %lo(foo) # encoding: [0x24,0x62,A,A]
58                                           // ENCLE: addiu $2, $3, %lo(foo) # encoding: [A,A,0x62,0x24]
59                                           // FIXUP: # fixup A - offset: 0, value: %lo(foo), kind: fixup_Mips_LO16
60
61        addiu $2, $3, %hi(bar)             // RELOC: R_MIPS_HI16 .data
62                                           // ENCBE: addiu $2, $3, %hi(bar) # encoding: [0x24,0x62,A,A]
63                                           // ENCLE: addiu $2, $3, %hi(bar) # encoding: [A,A,0x62,0x24]
64                                           // FIXUP: # fixup A - offset: 0, value: %hi(bar), kind: fixup_Mips_HI16
65
66        addiu $2, $3, %lo(bar)             // RELOC: R_MIPS_LO16 .data
67                                           // ENCBE: addiu $2, $3, %lo(bar) # encoding: [0x24,0x62,A,A]
68                                           // ENCLE: addiu $2, $3, %lo(bar) # encoding: [A,A,0x62,0x24]
69                                           // FIXUP: # fixup A - offset: 0, value: %lo(bar), kind: fixup_Mips_LO16
70
71        addiu $2, $3, %gp_rel(foo)         // RELOC: R_MIPS_GPREL16 foo
72                                           // ENCBE: addiu $2, $3, %gp_rel(foo) # encoding: [0x24,0x62,A,A]
73                                           // ENCLE: addiu $2, $3, %gp_rel(foo) # encoding: [A,A,0x62,0x24]
74                                           // FIXUP: # fixup A - offset: 0, value: %gp_rel(foo), kind: fixup_Mips_GPREL
75
76// DATA-NEXT:  0030: 24620004 24620000 24420000 24620000
77        addiu $2, $3, %gp_rel(bar)         // RELOC: R_MIPS_GPREL16 .data
78                                           // ENCBE: addiu $2, $3, %gp_rel(bar) # encoding: [0x24,0x62,A,A]
79                                           // ENCLE: addiu $2, $3, %gp_rel(bar) # encoding: [A,A,0x62,0x24]
80                                           // FIXUP: # fixup A - offset: 0, value: %gp_rel(bar), kind: fixup_Mips_GPREL
81
82                                           // ?????: R_MIPS_LITERAL foo
83
84        addiu $2, $3, %got(foo)            // RELOC: R_MIPS_GOT16 foo
85                                           // ENCBE: addiu $2, $3, %got(foo) # encoding: [0x24,0x62,A,A]
86                                           // ENCLE: addiu $2, $3, %got(foo) # encoding: [A,A,0x62,0x24]
87                                           // FIXUP: # fixup A - offset: 0, value: %got(foo), kind: fixup_Mips_GOT
88        // %got requires a %lo pair
89        addiu $2, $2, %lo(foo)
90
91        addiu $2, $3, %got(bar)            // RELOC: R_MIPS_GOT16 .data
92                                           // ENCBE: addiu $2, $3, %got(bar) # encoding: [0x24,0x62,A,A]
93                                           // ENCLE: addiu $2, $3, %got(bar) # encoding: [A,A,0x62,0x24]
94                                           // FIXUP: # fixup A - offset: 0, value: %got(bar), kind: fixup_Mips_GOT
95// DATA-NEXT:  0040: 24420004 0000FFBE 24620000
96        // %got requires a %lo pair
97        addiu $2, $2, %lo(bar)
98
99        .short foo-.                       // RELOC: R_MIPS_PC16 foo
100        .short baz-.                       // RELOC-NOT: R_MIPS_PC16
101
102        addiu $2, $3, %call16(foo)         // RELOC: R_MIPS_CALL16 foo
103                                           // ENCBE: addiu $2, $3, %call16(foo) # encoding: [0x24,0x62,A,A]
104                                           // ENCLE: addiu $2, $3, %call16(foo) # encoding: [A,A,0x62,0x24]
105                                           // FIXUP: # fixup A - offset: 0, value: %call16(foo), kind: fixup_Mips_CALL16
106
107	.p2align 4
108// DATA-NEXT:  0050: 00000000 00000000 00000000 00000004
109        .quad foo                          // RELOC: R_MIPS_64 foo
110        .quad bar                          // RELOC: R_MIPS_64 .data
111
112                                           // ?????: R_MIPS_GPREL32 foo
113                                           // ?????: R_MIPS_UNUSED1 foo
114                                           // ?????: R_MIPS_UNUSED2 foo
115                                           // ?????: R_MIPS_UNUSED3 foo
116                                           // ?????: R_MIPS_SHIFT5 foo
117                                           // ?????: R_MIPS_SHIFT6 foo
118
119// DATA-NEXT:  0060: 24620000 24620000 24620000 24620000
120        addiu $2, $3, %got_disp(foo)       // RELOC: R_MIPS_GOT_DISP foo
121                                           // ENCBE: addiu $2, $3, %got_disp(foo) # encoding: [0x24,0x62,A,A]
122                                           // ENCLE: addiu $2, $3, %got_disp(foo) # encoding: [A,A,0x62,0x24]
123                                           // FIXUP: # fixup A - offset: 0, value: %got_disp(foo), kind: fixup_Mips_GOT_DISP
124
125        addiu $2, $3, %got_page(foo)       // RELOC: R_MIPS_GOT_PAGE foo
126                                           // ENCBE: addiu $2, $3, %got_page(foo) # encoding: [0x24,0x62,A,A]
127                                           // ENCLE: addiu $2, $3, %got_page(foo) # encoding: [A,A,0x62,0x24]
128                                           // FIXUP: # fixup A - offset: 0, value: %got_page(foo), kind: fixup_Mips_GOT_PAGE
129
130        addiu $2, $3, %got_ofst(foo)       // RELOC: R_MIPS_GOT_OFST foo
131                                           // ENCBE: addiu $2, $3, %got_ofst(foo) # encoding: [0x24,0x62,A,A]
132                                           // ENCLE: addiu $2, $3, %got_ofst(foo) # encoding: [A,A,0x62,0x24]
133                                           // FIXUP: # fixup A - offset: 0, value: %got_ofst(foo), kind: fixup_Mips_GOT_OFST
134
135        addiu $2, $3, %got_hi(foo)         // RELOC: R_MIPS_GOT_HI16 foo
136                                           // ENCBE: addiu $2, $3, %got_hi(foo) # encoding: [0x24,0x62,A,A]
137                                           // ENCLE: addiu $2, $3, %got_hi(foo) # encoding: [A,A,0x62,0x24]
138                                           // FIXUP: # fixup A - offset: 0, value: %got_hi(foo), kind: fixup_Mips_GOT_HI16
139
140// DATA-NEXT:  0070: 24620000 64620000 64620000 24620000
141        addiu $2, $3, %got_lo(foo)         // RELOC: R_MIPS_GOT_LO16 foo
142                                           // ENCBE: addiu $2, $3, %got_lo(foo) # encoding: [0x24,0x62,A,A]
143                                           // ENCLE: addiu $2, $3, %got_lo(foo) # encoding: [A,A,0x62,0x24]
144                                           // FIXUP: # fixup A - offset: 0, value: %got_lo(foo), kind: fixup_Mips_GOT_LO16
145
146//      addiu $2, $3, %neg(foo)            // FIXME: R_MIPS_SUB foo
147                                           // ?????: R_MIPS_INSERT_A
148                                           // ?????: R_MIPS_INSERT_B
149                                           // ?????: R_MIPS_DELETE
150
151        .set mips64
152        daddiu $2, $3, %higher(foo)        // RELOC: R_MIPS_HIGHER foo
153                                           // ENCBE: daddiu $2, $3, %higher(foo) # encoding: [0x64,0x62,A,A]
154                                           // ENCLE: daddiu $2, $3, %higher(foo) # encoding: [A,A,0x62,0x64]
155                                           // FIXUP: # fixup A - offset: 0, value: %higher(foo), kind: fixup_Mips_HIGHER
156
157        daddiu $2, $3, %highest(foo)       // RELOC: R_MIPS_HIGHEST foo
158                                           // ENCBE: daddiu $2, $3, %highest(foo) # encoding: [0x64,0x62,A,A]
159                                           // ENCLE: daddiu $2, $3, %highest(foo) # encoding: [A,A,0x62,0x64]
160                                           // FIXUP: # fixup A - offset: 0, value: %highest(foo), kind: fixup_Mips_HIGHEST
161
162        .set mips0
163        addiu $2, $3, %call_hi(foo)        // RELOC: R_MIPS_CALL_HI16 foo
164                                           // ENCBE: addiu $2, $3, %call_hi(foo) # encoding: [0x24,0x62,A,A]
165                                           // ENCLE: addiu $2, $3, %call_hi(foo) # encoding: [A,A,0x62,0x24]
166                                           // FIXUP: # fixup A - offset: 0, value: %call_hi(foo), kind: fixup_Mips_CALL_HI16
167
168// DATA-NEXT:  0080: 24620000 24620000 24620000 24620000
169        addiu $2, $3, %call_lo(foo)        // RELOC: R_MIPS_CALL_LO16 foo
170                                           // ENCBE: addiu $2, $3, %call_lo(foo) # encoding: [0x24,0x62,A,A]
171                                           // ENCLE: addiu $2, $3, %call_lo(foo) # encoding: [A,A,0x62,0x24]
172                                           // FIXUP: # fixup A - offset: 0, value: %call_lo(foo), kind: fixup_Mips_CALL_LO16
173
174                                           // ?????: R_MIPS_SCN_DISP foo
175                                           // ?????: R_MIPS_REL16 foo
176                                           // ?????: R_MIPS_ADD_IMMEDIATE foo
177                                           // ?????: R_MIPS_PJUMP foo
178                                           // ?????: R_MIPS_RELGOT foo
179//      jalr $25                           // ?????: R_MIPS_JALR foo
180
181                                           // ?????: R_MIPS_TLS_DTPMOD32 foo
182//      .dtprelword foo                    // FIXME: R_MIPS_TLS_DTPREL32 foo
183                                           // ?????: R_MIPS_TLS_DTPMOD64 foo
184//      .dtpreldword foo                   // FIXME: R_MIPS_TLS_DTPREL64 foo
185        addiu $2, $3, %tlsgd(foo)          // RELOC: R_MIPS_TLS_GD foo
186                                           // ENCBE: addiu $2, $3, %tlsgd(foo) # encoding: [0x24,0x62,A,A]
187                                           // ENCLE: addiu $2, $3, %tlsgd(foo) # encoding: [A,A,0x62,0x24]
188                                           // FIXUP: # fixup A - offset: 0, value: %tlsgd(foo), kind: fixup_Mips_TLSGD
189
190        addiu $2, $3, %tlsldm(foo)         // RELOC: R_MIPS_TLS_LDM foo
191                                           // ENCBE: addiu $2, $3, %tlsldm(foo) # encoding: [0x24,0x62,A,A]
192                                           // ENCLE: addiu $2, $3, %tlsldm(foo) # encoding: [A,A,0x62,0x24]
193                                           // FIXUP: # fixup A - offset: 0, value: %tlsldm(foo), kind: fixup_Mips_TLSLDM
194
195        addiu $2, $3, %dtprel_hi(foo)      // RELOC: R_MIPS_TLS_DTPREL_HI16 foo
196                                           // ENCBE: addiu $2, $3, %dtprel_hi(foo) # encoding: [0x24,0x62,A,A]
197                                           // ENCLE: addiu $2, $3, %dtprel_hi(foo) # encoding: [A,A,0x62,0x24]
198                                           // FIXUP: # fixup A - offset: 0, value: %dtprel_hi(foo), kind: fixup_Mips_DTPREL_HI
199
200        addiu $2, $3, %dtprel_lo(foo)      // RELOC: R_MIPS_TLS_DTPREL_LO16 foo
201                                           // ENCBE: addiu $2, $3, %dtprel_lo(foo) # encoding: [0x24,0x62,A,A]
202                                           // ENCLE: addiu $2, $3, %dtprel_lo(foo) # encoding: [A,A,0x62,0x24]
203                                           // FIXUP: # fixup A - offset: 0, value: %dtprel_lo(foo), kind: fixup_Mips_DTPREL_LO
204
205        addiu $2, $3, %gottprel(foo)       // RELOC: R_MIPS_TLS_GOTTPREL foo
206                                           // ENCBE: addiu $2, $3, %gottprel(foo) # encoding: [0x24,0x62,A,A]
207                                           // ENCLE: addiu $2, $3, %gottprel(foo) # encoding: [A,A,0x62,0x24]
208                                           // FIXUP: # fixup A - offset: 0, value: %gottprel(foo), kind: fixup_Mips_GOTTPREL
209
210//      .tprelword foo                     // FIXME: R_MIPS_TLS_TPREL32 foo
211//      .tpreldword foo                    // FIXME: R_MIPS_TLS_TPREL64 foo
212        addiu $2, $3, %tprel_hi(foo)       // RELOC: R_MIPS_TLS_TPREL_HI16 foo
213                                           // ENCBE: addiu $2, $3, %tprel_hi(foo) # encoding: [0x24,0x62,A,A]
214                                           // ENCLE: addiu $2, $3, %tprel_hi(foo) # encoding: [A,A,0x62,0x24]
215                                           // FIXUP: # fixup A - offset: 0, value: %tprel_hi(foo), kind: fixup_Mips_TPREL_HI
216
217        addiu $2, $3, %tprel_lo(foo)       // RELOC: R_MIPS_TLS_TPREL_LO16 foo
218                                           // ENCBE: addiu $2, $3, %tprel_lo(foo) # encoding: [0x24,0x62,A,A]
219                                           // ENCLE: addiu $2, $3, %tprel_lo(foo) # encoding: [A,A,0x62,0x24]
220                                           // FIXUP: # fixup A - offset: 0, value: %tprel_lo(foo), kind: fixup_Mips_TPREL_LO
221
222                                           // ?????: R_MIPS_GLOB_DAT foo
223        .set mips32r6
224        beqzc $2, foo                      // RELOC: R_MIPS_PC21_S2 foo
225                                           // ENCBE: beqzc $2, foo # encoding: [0xd8,0b010AAAAA,A,A]
226                                           // ENCLE: beqzc $2, foo # encoding: [A,A,0b010AAAAA,0xd8]
227                                           // FIXUP: # fixup A - offset: 0, value: foo-4, kind: fixup_MIPS_PC21_S2
228
229        bc foo                             // RELOC: R_MIPS_PC26_S2 foo
230                                           // ENCBE: bc foo # encoding: [0b110010AA,A,A,A]
231                                           // ENCLE: bc foo # encoding: [A,A,A,0b110010AA]
232                                           // FIXUP: # fixup A - offset: 0, value: foo-4, kind: fixup_MIPS_PC26_S2
233
234        .set mips64r6
235        ldpc $2, foo                       // RELOC: R_MIPS_PC18_S3 foo
236                                           // ENCBE: ldpc $2, foo # encoding: [0xec,0b010110AA,A,A]
237                                           // ENCLE: ldpc $2, foo # encoding: [A,A,0b010110AA,0xec]
238                                           // FIXUP: # fixup A - offset: 0, value: foo, kind: fixup_Mips_PC18_S3
239
240        .set mips32r6
241        lwpc $2, foo                       // RELOC: R_MIPS_PC19_S2 foo
242                                           // ENCBE: lwpc $2, foo # encoding: [0xec,0b01001AAA,A,A]
243                                           // ENCLE: lwpc $2, foo # encoding: [A,A,0b01001AAA,0xec]
244                                           // FIXUP: # fixup A - offset: 0, value: foo, kind: fixup_MIPS_PC19_S2
245
246        addiu $2, $3, %pcrel_hi(foo)       // RELOC: R_MIPS_PCHI16 foo
247                                           // ENCBE: addiu $2, $3, %pcrel_hi(foo) # encoding: [0x24,0x62,A,A]
248                                           // ENCLE: addiu $2, $3, %pcrel_hi(foo) # encoding: [A,A,0x62,0x24]
249                                           // FIXUP: # fixup A - offset: 0, value: %pcrel_hi(foo), kind: fixup_MIPS_PCHI16
250
251        addiu $2, $3, %pcrel_lo(foo)       // RELOC: R_MIPS_PCLO16 foo
252                                           // ENCBE: addiu $2, $3, %pcrel_lo(foo) # encoding: [0x24,0x62,A,A]
253                                           // ENCLE: addiu $2, $3, %pcrel_lo(foo) # encoding: [A,A,0x62,0x24]
254                                           // FIXUP: # fixup A - offset: 0, value: %pcrel_lo(foo), kind: fixup_MIPS_PCLO16
255
256        .set mips0
257                                           // FIXME: R_MIPS16_*
258                                           // ?????: R_MIPS_COPY foo
259                                           // ?????: R_MIPS_JUMP_SLOT foo
260                                           // FIXME: R_MICROMIPS_*
261        .long foo-.                        // RELOC: R_MIPS_PC32 foo
262//      .ehword foo                        // FIXME: R_MIPS_EH foo
263
264	.data
265	.word 0
266bar:
267	.word 1
268
269        .section .text_mm, "ax", @progbits
270        .set micromips
271mm:
272// RELOC-LABEL: .rel.text_mm {
273// ENCBE-LABEL: mm:
274// ENCLE-LABEL: mm:
275// DATA-LABEL: Name: .text_mm
276// DATA:       SectionData (
277
278// DATA-NEXT:  0000: 30430000 30420000 30430000 30420004
279        addiu $2, $3, %got(foo_mm)         // RELOC: R_MICROMIPS_GOT16 foo_mm
280                                           // ENCBE: addiu $2, $3, %got(foo_mm) # encoding: [0x30,0x43,A,A]
281                                           // The placement of the 'A' annotations is incorrect. They use 32-bit little endian instead of 2x 16-bit little endian.
282                                           // ENCLE: addiu $2, $3, %got(foo_mm) # encoding: [0x43'A',0x30'A',0x00,0x00]
283                                           // FIXUP: # fixup A - offset: 0, value: %got(foo_mm), kind: fixup_MICROMIPS_GOT16
284        // %got requires a %lo pair
285        addiu $2, $2, %lo(foo_mm)          // RELOC: R_MICROMIPS_LO16 foo_mm
286                                           // ENCBE: addiu $2, $2, %lo(foo_mm) # encoding: [0x30,0x42,A,A]
287                                           // ENCLE: addiu $2, $2, %lo(foo_mm) # encoding: [0x42'A',0x30'A',0x00,0x00]
288                                           // FIXUP: # fixup A - offset: 0, value: %lo(foo_mm), kind: fixup_MICROMIPS_LO16
289
290foo_mm:
291        addiu $2, $3, %got(bar)            // RELOC: R_MICROMIPS_GOT16 .data
292                                           // ENCBE: addiu $2, $3, %got(bar) # encoding: [0x30,0x43,A,A]
293                                           // ENCLE: addiu $2, $3, %got(bar) # encoding: [0x43'A',0x30'A',0x00,0x00]
294                                           // FIXUP: # fixup A - offset: 0, value: %got(bar), kind: fixup_MICROMIPS_GOT16
295        // %got requires a %lo pair
296        addiu $2, $2, %lo(bar)             // RELOC: R_MICROMIPS_LO16 .data
297                                           // ENCBE: addiu $2, $2, %lo(bar) # encoding: [0x30,0x42,A,A]
298                                           // ENCLE: addiu $2, $2, %lo(bar) # encoding: [0x42'A',0x30'A',0x00,0x00]
299                                           // FIXUP: # fixup A - offset: 0, value: %lo(bar), kind: fixup_MICROMIPS_LO16
300
301// DATA-NEXT:  0010: 30430000 30420004 30430001 30420030
302        addiu $2, $3, %got(baz)            // RELOC: R_MICROMIPS_GOT16 .text
303                                           // ENCBE: addiu $2, $3, %got(baz) # encoding: [0x30,0x43,A,A]
304                                           // The placement of the 'A' annotations is incorrect. They use 32-bit little endian instead of 2x 16-bit little endian.
305                                           // ENCLE: addiu $2, $3, %got(baz) # encoding: [0x43'A',0x30'A',0x00,0x00]
306                                           // FIXUP: # fixup A - offset: 0, value: %got(baz), kind: fixup_MICROMIPS_GOT16
307        // %got requires a %lo pair
308        addiu $2, $2, %lo(baz)             // RELOC: R_MICROMIPS_LO16 .text
309                                           // ENCBE: addiu $2, $2, %lo(baz) # encoding: [0x30,0x42,A,A]
310                                           // ENCLE: addiu $2, $2, %lo(baz) # encoding: [0x42'A',0x30'A',0x00,0x00]
311                                           // FIXUP: # fixup A - offset: 0, value: %lo(baz), kind: fixup_MICROMIPS_LO16
312
313        addiu $2, $3, %got(long_mm)        // RELOC: R_MICROMIPS_GOT16 .text
314                                           // ENCBE: addiu $2, $3, %got(long_mm) # encoding: [0x30,0x43,A,A]
315                                           // The placement of the 'A' annotations is incorrect. They use 32-bit little endian instead of 2x 16-bit little endian.
316                                           // ENCLE: addiu $2, $3, %got(long_mm) # encoding: [0x43'A',0x30'A',0x00,0x00]
317                                           // FIXUP: # fixup A - offset: 0, value: %got(long_mm), kind: fixup_MICROMIPS_GOT16
318        // %got requires a %lo pair
319        addiu $2, $2, %lo(long_mm)         // RELOC: R_MICROMIPS_LO16 .text
320                                           // ENCBE: addiu $2, $2, %lo(long_mm) # encoding: [0x30,0x42,A,A]
321                                           // ENCLE: addiu $2, $2, %lo(long_mm) # encoding: [0x42'A',0x30'A',0x00,0x00]
322                                           // FIXUP: # fixup A - offset: 0, value: %lo(long_mm), kind: fixup_MICROMIPS_LO16
323
324// DATA-NEXT:  0020: 30430000 30420000 30430000 30420004
325        addiu $2, $3, %hi(foo_mm)          // RELOC: R_MICROMIPS_HI16 foo_mm
326                                           // ENCBE: addiu $2, $3, %hi(foo_mm) # encoding: [0x30,0x43,A,A]
327                                           // ENCLE: addiu $2, $3, %hi(foo_mm) # encoding: [0x43'A',0x30'A',0x00,0x00]
328                                           // FIXUP: # fixup A - offset: 0, value: %hi(foo_mm), kind: fixup_MICROMIPS_HI16
329
330        addiu $2, $2, %lo(foo_mm)          // RELOC: R_MICROMIPS_LO16 foo_mm
331                                           // ENCBE: addiu $2, $2, %lo(foo_mm) # encoding: [0x30,0x42,A,A]
332                                           // ENCLE: addiu $2, $2, %lo(foo_mm) # encoding: [0x42'A',0x30'A',0x00,0x00]
333                                           // FIXUP: # fixup A - offset: 0, value: %lo(foo_mm), kind: fixup_MICROMIPS_LO16
334
335        addiu $2, $3, %hi(bar)             // RELOC: R_MICROMIPS_HI16 .data
336                                           // ENCBE: addiu $2, $3, %hi(bar) # encoding: [0x30,0x43,A,A]
337                                           // ENCLE: addiu $2, $3, %hi(bar) # encoding: [0x43'A',0x30'A',0x00,0x00]
338                                           // FIXUP: # fixup A - offset: 0, value: %hi(bar), kind: fixup_MICROMIPS_HI16
339
340        addiu $2, $2, %lo(bar)             // RELOC: R_MICROMIPS_LO16 .data
341                                           // ENCBE: addiu $2, $2, %lo(bar) # encoding: [0x30,0x42,A,A]
342                                           // ENCLE: addiu $2, $2, %lo(bar) # encoding: [0x42'A',0x30'A',0x00,0x00]
343                                           // FIXUP: # fixup A - offset: 0, value: %lo(bar), kind: fixup_MICROMIPS_LO16
344
345        .space 65536, 0
346long_mm:
347