@@ -1247,13 +1247,14 @@ mod tests {
1247
1247
1248
1248
#[ test]
1249
1249
fn test_reorder_c_args_no_cycle ( ) {
1250
+ crate :: options:: rb_zjit_prepare_options ( ) ;
1250
1251
let ( mut asm, mut cb) = setup_asm ( ) ;
1251
1252
1252
1253
asm. ccall ( 0 as _ , vec ! [
1253
1254
C_ARG_OPNDS [ 0 ] , // mov rdi, rdi (optimized away)
1254
1255
C_ARG_OPNDS [ 1 ] , // mov rsi, rsi (optimized away)
1255
1256
] ) ;
1256
- asm. compile_with_num_regs ( & mut cb, 0 ) ;
1257
+ asm. compile_with_num_regs ( & mut cb, ALLOC_REGS . len ( ) ) ;
1257
1258
1258
1259
assert_disasm ! ( cb, "b800000000ffd0" , { "
1259
1260
0x0: mov eax, 0
@@ -1263,6 +1264,7 @@ mod tests {
1263
1264
1264
1265
#[ test]
1265
1266
fn test_reorder_c_args_single_cycle ( ) {
1267
+ crate :: options:: rb_zjit_prepare_options ( ) ;
1266
1268
let ( mut asm, mut cb) = setup_asm ( ) ;
1267
1269
1268
1270
// rdi and rsi form a cycle
@@ -1271,7 +1273,7 @@ mod tests {
1271
1273
C_ARG_OPNDS [ 0 ] , // mov rsi, rdi
1272
1274
C_ARG_OPNDS [ 2 ] , // mov rdx, rdx (optimized away)
1273
1275
] ) ;
1274
- asm. compile_with_num_regs ( & mut cb, 0 ) ;
1276
+ asm. compile_with_num_regs ( & mut cb, ALLOC_REGS . len ( ) ) ;
1275
1277
1276
1278
assert_disasm ! ( cb, "4989f34889fe4c89dfb800000000ffd0" , { "
1277
1279
0x0: mov r11, rsi
@@ -1284,6 +1286,7 @@ mod tests {
1284
1286
1285
1287
#[ test]
1286
1288
fn test_reorder_c_args_two_cycles ( ) {
1289
+ crate :: options:: rb_zjit_prepare_options ( ) ;
1287
1290
let ( mut asm, mut cb) = setup_asm ( ) ;
1288
1291
1289
1292
// rdi and rsi form a cycle, and rdx and rcx form another cycle
@@ -1293,7 +1296,7 @@ mod tests {
1293
1296
C_ARG_OPNDS [ 3 ] , // mov rdx, rcx
1294
1297
C_ARG_OPNDS [ 2 ] , // mov rcx, rdx
1295
1298
] ) ;
1296
- asm. compile_with_num_regs ( & mut cb, 0 ) ;
1299
+ asm. compile_with_num_regs ( & mut cb, ALLOC_REGS . len ( ) ) ;
1297
1300
1298
1301
assert_disasm ! ( cb, "4989f34889fe4c89df4989cb4889d14c89dab800000000ffd0" , { "
1299
1302
0x0: mov r11, rsi
@@ -1309,6 +1312,7 @@ mod tests {
1309
1312
1310
1313
#[ test]
1311
1314
fn test_reorder_c_args_large_cycle ( ) {
1315
+ crate :: options:: rb_zjit_prepare_options ( ) ;
1312
1316
let ( mut asm, mut cb) = setup_asm ( ) ;
1313
1317
1314
1318
// rdi, rsi, and rdx form a cycle
@@ -1317,7 +1321,7 @@ mod tests {
1317
1321
C_ARG_OPNDS [ 2 ] , // mov rsi, rdx
1318
1322
C_ARG_OPNDS [ 0 ] , // mov rdx, rdi
1319
1323
] ) ;
1320
- asm. compile_with_num_regs ( & mut cb, 0 ) ;
1324
+ asm. compile_with_num_regs ( & mut cb, ALLOC_REGS . len ( ) ) ;
1321
1325
1322
1326
assert_disasm ! ( cb, "4989f34889d64889fa4c89dfb800000000ffd0" , { "
1323
1327
0x0: mov r11, rsi
0 commit comments