OSDN Git Service

Use TestCodeGeneratorX86 in codegen unit tests
authorMatthew Gharrity <gharrma@google.com>
Fri, 12 Aug 2016 00:20:05 +0000 (17:20 -0700)
committerMatthew Gharrity <gharrma@google.com>
Fri, 12 Aug 2016 00:32:19 +0000 (17:32 -0700)
The codegen unit tests are supposed to use special "test" code
generators when targeting ARM and x86 (due to differing calling
conventions between the C++ source code and the generated code),
yet TestCodeGeneratorX86 was not being used. This fixes that.

(The tests were only succeeding because the register allocator happened
to not assign the EBX register.)

Test: m test-art-host-gtest-codegen_test

Change-Id: Ia3dd6998c38e9ff27b8c2734457f86b3fed44ab4

compiler/optimizing/codegen_test.cc

index fe9a7af..18db507 100644 (file)
@@ -247,7 +247,7 @@ static void RunCode(InstructionSet target_isa,
   } else if (target_isa == kX86) {
     std::unique_ptr<const X86InstructionSetFeatures> features_x86(
         X86InstructionSetFeatures::FromCppDefines());
-    x86::CodeGeneratorX86 codegenX86(graph, *features_x86.get(), compiler_options);
+    TestCodeGeneratorX86 codegenX86(graph, *features_x86.get(), compiler_options);
     RunCode(&codegenX86, graph, hook_before_codegen, has_result, expected);
   } else if (target_isa == kX86_64) {
     std::unique_ptr<const X86_64InstructionSetFeatures> features_x86_64(