summaryrefslogtreecommitdiff
path: root/runtime/dexopt_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/dexopt_test.cc')
-rw-r--r--runtime/dexopt_test.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/runtime/dexopt_test.cc b/runtime/dexopt_test.cc
index 037d1fb49c..8ce7921287 100644
--- a/runtime/dexopt_test.cc
+++ b/runtime/dexopt_test.cc
@@ -49,7 +49,8 @@ void DexoptTest::GenerateOatForTest(const std::string& dex_location,
CompilerFilter::Filter filter,
bool relocate,
bool pic,
- bool with_alternate_image) {
+ bool with_alternate_image,
+ const char* compilation_reason) {
std::string dalvik_cache = GetDalvikCache(GetInstructionSetString(kRuntimeISA));
std::string dalvik_cache_tmp = dalvik_cache + ".redirected";
std::string oat_location = oat_location_in;
@@ -89,6 +90,10 @@ void DexoptTest::GenerateOatForTest(const std::string& dex_location,
args.push_back("--boot-image=" + GetImageLocation2());
}
+ if (compilation_reason != nullptr) {
+ args.push_back("--compilation-reason=" + std::string(compilation_reason));
+ }
+
std::string error_msg;
ASSERT_TRUE(OatFileAssistant::Dex2Oat(args, &error_msg)) << error_msg;
@@ -155,13 +160,15 @@ void DexoptTest::GenerateOdexForTest(const std::string& dex_location,
void DexoptTest::GeneratePicOdexForTest(const std::string& dex_location,
const std::string& odex_location,
- CompilerFilter::Filter filter) {
+ CompilerFilter::Filter filter,
+ const char* compilation_reason) {
GenerateOatForTest(dex_location,
odex_location,
filter,
/*relocate*/false,
/*pic*/true,
- /*with_alternate_image*/false);
+ /*with_alternate_image*/false,
+ compilation_reason);
}
void DexoptTest::GenerateOatForTest(const char* dex_location,