summaryrefslogtreecommitdiff
path: root/compiler/common_compiler_test.cc
diff options
context:
space:
mode:
author Roland Levillain <rpl@google.com> 2016-02-01 15:48:42 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-02-01 15:48:42 +0000
commitd111cce1d266567d71be828c4213f3456dbdac2c (patch)
tree680f6becafc46e2651c9c04d05c377578122b62f /compiler/common_compiler_test.cc
parentbceee26590c8c757987689d2e1002c2f98f0ab33 (diff)
parent324302696c0a93511fef1310d309a54ebfb25a46 (diff)
Merge "Ensure instruction cache is flushed in compiler tests with Clang."
Diffstat (limited to 'compiler/common_compiler_test.cc')
-rw-r--r--compiler/common_compiler_test.cc11
1 files changed, 1 insertions, 10 deletions
diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc
index afc8463878..e4bfac9ee7 100644
--- a/compiler/common_compiler_test.cc
+++ b/compiler/common_compiler_test.cc
@@ -122,16 +122,7 @@ void CommonCompilerTest::MakeExecutable(const void* code_start, size_t code_leng
int result = mprotect(reinterpret_cast<void*>(base), len, PROT_READ | PROT_WRITE | PROT_EXEC);
CHECK_EQ(result, 0);
- // Flush instruction cache
- // Only uses __builtin___clear_cache if GCC >= 4.3.3
-#if GCC_VERSION >= 40303
- __builtin___clear_cache(reinterpret_cast<void*>(base), reinterpret_cast<void*>(base + len));
-#else
- // Only warn if not Intel as Intel doesn't have cache flush instructions.
-#if !defined(__i386__) && !defined(__x86_64__)
- UNIMPLEMENTED(WARNING) << "cache flush";
-#endif
-#endif
+ FlushInstructionCache(reinterpret_cast<char*>(base), reinterpret_cast<char*>(base + len));
}
void CommonCompilerTest::MakeExecutable(mirror::ClassLoader* class_loader, const char* class_name) {