Index: test/cctest/compiler/test-multiple-return.cc |
diff --git a/test/cctest/compiler/test-multiple-return.cc b/test/cctest/compiler/test-multiple-return.cc |
index b15f7791f2078a396fca012219316380654ea928..6fd84a9872b0cee8a715e7b6a0a4467cd1783689 100644 |
--- a/test/cctest/compiler/test-multiple-return.cc |
+++ b/test/cctest/compiler/test-multiple-return.cc |
@@ -29,17 +29,22 @@ CallDescriptor* GetCallDescriptor(Zone* zone, int return_count, |
int param_count) { |
MachineSignature::Builder msig(zone, return_count, param_count); |
LocationSignature::Builder locations(zone, return_count, param_count); |
+ const RegisterConfiguration* config = RegisterConfiguration::ArchDefault(); |
// Add return location(s). |
+ DCHECK(return_count <= config->num_allocatable_general_registers()); |
for (int i = 0; i < return_count; i++) { |
msig.AddReturn(compiler::kMachInt32); |
- locations.AddReturn(LinkageLocation::ForRegister(i)); |
+ locations.AddReturn( |
+ LinkageLocation::ForRegister(config->allocatable_general_codes()[i])); |
} |
// Add register and/or stack parameter(s). |
+ DCHECK(param_count <= config->num_allocatable_general_registers()); |
for (int i = 0; i < param_count; i++) { |
msig.AddParam(compiler::kMachInt32); |
- locations.AddParam(LinkageLocation::ForRegister(i)); |
+ locations.AddParam( |
+ LinkageLocation::ForRegister(config->allocatable_general_codes()[i])); |
} |
const RegList kCalleeSaveRegisters = 0; |