@@ -151,11 +151,9 @@ fn test_jo_label() {
151
151
#[ test]
152
152
fn test_lea ( ) {
153
153
check_bytes ( "488d5108" , |cb| lea ( cb, RDX , mem_opnd ( 64 , RCX , 8 ) ) ) ;
154
-
155
- // TODO(kevin)
156
- // check_bytes("488d0500000000", |cb| lea(cb, RAX, mem_opnd(8, RIP, 0)));
157
- // check_bytes("488d0505000000", |cb| lea(cb, RAX, mem_opnd(8, RIP, 5)));
158
- // check_bytes("488d3d05000000", |cb| lea(cb, RDI, mem_opnd(8, RIP, 5)));
154
+ check_bytes ( "488d0500000000" , |cb| lea ( cb, RAX , mem_opnd ( 8 , RIP , 0 ) ) ) ;
155
+ check_bytes ( "488d0505000000" , |cb| lea ( cb, RAX , mem_opnd ( 8 , RIP , 5 ) ) ) ;
156
+ check_bytes ( "488d3d05000000" , |cb| lea ( cb, RDI , mem_opnd ( 8 , RIP , 5 ) ) ) ;
159
157
}
160
158
161
159
#[ test]
@@ -235,6 +233,16 @@ fn test_mov_unsigned() {
235
233
check_bytes ( "49b8ffffffffffffffff" , |cb| mov ( cb, R8 , uimm_opnd ( u64:: MAX ) ) ) ;
236
234
}
237
235
236
+ #[ test]
237
+ fn test_mov_iprel ( ) {
238
+ check_bytes ( "8b0500000000" , |cb| mov ( cb, EAX , mem_opnd ( 32 , RIP , 0 ) ) ) ;
239
+ check_bytes ( "8b0505000000" , |cb| mov ( cb, EAX , mem_opnd ( 32 , RIP , 5 ) ) ) ;
240
+
241
+ check_bytes ( "488b0500000000" , |cb| mov ( cb, RAX , mem_opnd ( 64 , RIP , 0 ) ) ) ;
242
+ check_bytes ( "488b0505000000" , |cb| mov ( cb, RAX , mem_opnd ( 64 , RIP , 5 ) ) ) ;
243
+ check_bytes ( "488b3d05000000" , |cb| mov ( cb, RDI , mem_opnd ( 64 , RIP , 5 ) ) ) ;
244
+ }
245
+
238
246
#[ test]
239
247
fn test_movsx ( ) {
240
248
check_bytes ( "660fbec0" , |cb| movsx ( cb, AX , AL ) ) ;
@@ -250,7 +258,17 @@ fn test_movsx() {
250
258
#[ test]
251
259
fn test_nop ( ) {
252
260
check_bytes ( "90" , |cb| nop ( cb, 1 ) ) ;
253
- // TODO: we should test some multibyte nop encodings
261
+ check_bytes ( "6690" , |cb| nop ( cb, 2 ) ) ;
262
+ check_bytes ( "0f1f00" , |cb| nop ( cb, 3 ) ) ;
263
+ check_bytes ( "0f1f4000" , |cb| nop ( cb, 4 ) ) ;
264
+ check_bytes ( "0f1f440000" , |cb| nop ( cb, 5 ) ) ;
265
+ check_bytes ( "660f1f440000" , |cb| nop ( cb, 6 ) ) ;
266
+ check_bytes ( "0f1f8000000000" , |cb| nop ( cb, 7 ) ) ;
267
+ check_bytes ( "0f1f840000000000" , |cb| nop ( cb, 8 ) ) ;
268
+ check_bytes ( "660f1f840000000000" , |cb| nop ( cb, 9 ) ) ;
269
+ check_bytes ( "660f1f84000000000090" , |cb| nop ( cb, 10 ) ) ;
270
+ check_bytes ( "660f1f8400000000006690" , |cb| nop ( cb, 11 ) ) ;
271
+ check_bytes ( "660f1f8400000000000f1f00" , |cb| nop ( cb, 12 ) ) ;
254
272
}
255
273
256
274
#[ test]
@@ -352,9 +370,7 @@ fn test_test() {
352
370
check_bytes ( "4885472a" , |cb| test ( cb, mem_opnd ( 64 , RDI , 42 ) , RAX ) ) ;
353
371
check_bytes ( "4885c0" , |cb| test ( cb, RAX , RAX ) ) ;
354
372
check_bytes ( "4885f0" , |cb| test ( cb, RAX , RSI ) ) ;
355
-
356
- // TODO(kevin)
357
- // check_bytes("48f74640f7ffffff", |cb| test(cb, mem_opnd(64, RSI, 64), imm_opnd(!0x08)));
373
+ check_bytes ( "48f74640f7ffffff" , |cb| test ( cb, mem_opnd ( 64 , RSI , 64 ) , imm_opnd ( !0x08 ) ) ) ;
358
374
}
359
375
360
376
#[ test]
0 commit comments