From: danno@chromium.org Date: Fri, 16 Aug 2013 11:29:54 +0000 (+0000) Subject: Fix bug in test-code-stubs-x64 which meant not all registers were being checked. X-Git-Tag: upstream/4.7.83~12936 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d5762717d6eb1e1a9d830fdd1dcd61e851339391;p=platform%2Fupstream%2Fv8.git Fix bug in test-code-stubs-x64 which meant not all registers were being checked. Also change test-code-stubs-ia32 to use the same style as x64. BUG= R=danno@chromium.org Review URL: https://codereview.chromium.org/22865006 Patch from Ross McIlroy . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16203 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/test/cctest/test-code-stubs-ia32.cc b/test/cctest/test-code-stubs-ia32.cc index a3c0b54..3f62175 100644 --- a/test/cctest/test-code-stubs-ia32.cc +++ b/test/cctest/test-code-stubs-ia32.cc @@ -136,46 +136,15 @@ TEST(ConvertDToI) { RunAllTruncationTests(&ConvertDToICVersion); #endif - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esp, eax)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esp, ebx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esp, ecx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esp, edx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esp, edi)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esp, esi)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, eax, eax)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, eax, ebx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, eax, ecx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, eax, edx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, eax, edi)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, eax, esi)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ebx, eax)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ebx, ebx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ebx, ecx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ebx, edx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ebx, edi)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ebx, esi)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ecx, eax)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ecx, ebx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ecx, ecx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ecx, edx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ecx, edi)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ecx, esi)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edx, eax)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edx, ebx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edx, ecx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edx, edx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edx, edi)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edx, esi)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esi, eax)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esi, ebx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esi, ecx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esi, edx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esi, edi)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esi, esi)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edi, eax)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edi, ebx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edi, ecx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edi, edx)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edi, edi)); - RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edi, esi)); + Register source_registers[] = {esp, eax, ebx, ecx, edx, edi, esi}; + Register dest_registers[] = {eax, ebx, ecx, edx, edi, esi}; + + for (size_t s = 0; s < sizeof(source_registers) / sizeof(Register); s++) { + for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) { + RunAllTruncationTests( + MakeConvertDToIFuncTrampoline(isolate, + source_registers[s], + dest_registers[d])); + } + } } diff --git a/test/cctest/test-code-stubs-x64.cc b/test/cctest/test-code-stubs-x64.cc index 0bffb87..4af5b45 100644 --- a/test/cctest/test-code-stubs-x64.cc +++ b/test/cctest/test-code-stubs-x64.cc @@ -138,8 +138,8 @@ TEST(ConvertDToI) { Register source_registers[] = {rsp, rax, rbx, rcx, rdx, rsi, rdi, r8, r9}; Register dest_registers[] = {rax, rbx, rcx, rdx, rsi, rdi, r8, r9}; - for (size_t s = 0; s < sizeof(*source_registers); s++) { - for (size_t d = 0; d < sizeof(*dest_registers); d++) { + for (size_t s = 0; s < sizeof(source_registers) / sizeof(Register); s++) { + for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) { RunAllTruncationTests( MakeConvertDToIFuncTrampoline(isolate, source_registers[s],