summaryrefslogtreecommitdiff
path: root/compiler/common_compiler_test.h
diff options
context:
space:
mode:
authorRoland Levillain <rpl@google.com>2015-06-30 14:16:48 +0100
committerRoland Levillain <rpl@google.com>2015-06-30 14:16:48 +0100
commitbbcc01a5a38d28c221c05788e56473a287f57589 (patch)
treebc3f3ad22ee78ddf92fb3ff2344aa9197c2c1d6c /compiler/common_compiler_test.h
parent3b0667c1d68ba88c71b031757b757dca659afd69 (diff)
Make compiler-related gtests honor ART_USE_OPTIMIZING_COMPILER.
Previously, gtests using the art::CommonCompilerTest class were using Quick as compiler. Now, setting the environment variable ART_USE_OPTIMIZING_COMPILER to `true` before building and running these tests will use Optimizing instead. Change-Id: I724a3215d2eb1841089745fbabb5cb58b0422ef3
Diffstat (limited to 'compiler/common_compiler_test.h')
-rw-r--r--compiler/common_compiler_test.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/compiler/common_compiler_test.h b/compiler/common_compiler_test.h
index 769319be40..b828fcf7e1 100644
--- a/compiler/common_compiler_test.h
+++ b/compiler/common_compiler_test.h
@@ -22,6 +22,7 @@
#include <vector>
#include "common_runtime_test.h"
+#include "compiler.h"
#include "oat_file.h"
namespace art {
@@ -55,7 +56,10 @@ class CommonCompilerTest : public CommonRuntimeTest {
protected:
virtual void SetUp();
- virtual void SetUpRuntimeOptions(RuntimeOptions *options);
+ virtual void SetUpRuntimeOptions(RuntimeOptions* options);
+
+ Compiler::Kind GetCompilerKind() const;
+ void SetCompilerKind(Compiler::Kind compiler_kind);
// Get the set of image classes given to the compiler-driver in SetUp. Note: the compiler
// driver assumes ownership of the set, so the test should properly release the set.
@@ -88,6 +92,7 @@ class CommonCompilerTest : public CommonRuntimeTest {
void UnreserveImageSpace();
+ Compiler::Kind compiler_kind_ = kUseOptimizingCompiler ? Compiler::kOptimizing : Compiler::kQuick;
std::unique_ptr<CompilerOptions> compiler_options_;
std::unique_ptr<VerificationResults> verification_results_;
std::unique_ptr<DexFileToMethodInlinerMap> method_inliner_map_;
@@ -103,6 +108,13 @@ class CommonCompilerTest : public CommonRuntimeTest {
std::list<std::vector<uint8_t>> header_code_and_maps_chunks_;
};
+// TODO: When non-PIC works with all compilers in use, get rid of this.
+#define TEST_DISABLED_FOR_NON_PIC_COMPILING_WITH_OPTIMIZING() \
+ if (GetCompilerKind() == Compiler::kOptimizing) { \
+ printf("WARNING: TEST DISABLED FOR NON-PIC COMPILING WITH OPTIMIZING\n"); \
+ return; \
+ }
+
} // namespace art
#endif // ART_COMPILER_COMMON_COMPILER_TEST_H_