summaryrefslogtreecommitdiff
path: root/compiler/optimizing/side_effects_test.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2017-10-03 11:32:13 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-10-03 11:32:13 +0000
commit5adf26c26d6b662d95712f39c40946e23da8b650 (patch)
tree1c57801b08a66219e30354156b1e5c08c60a0f18 /compiler/optimizing/side_effects_test.cc
parent25ae37970757ab06bb75b63a933926a4db4bb38d (diff)
parentd5d2f2ce627aa0f6920d7ae05197abd1a396e035 (diff)
Merge "ART: Introduce Uint8 compiler data type."
Diffstat (limited to 'compiler/optimizing/side_effects_test.cc')
-rw-r--r--compiler/optimizing/side_effects_test.cc21
1 files changed, 15 insertions, 6 deletions
diff --git a/compiler/optimizing/side_effects_test.cc b/compiler/optimizing/side_effects_test.cc
index ac5eb15228..97317124ef 100644
--- a/compiler/optimizing/side_effects_test.cc
+++ b/compiler/optimizing/side_effects_test.cc
@@ -21,6 +21,19 @@
namespace art {
+// Only runtime types other than void are allowed.
+static const DataType::Type kTestTypes[] = {
+ DataType::Type::kReference,
+ DataType::Type::kBool,
+ DataType::Type::kInt8,
+ DataType::Type::kUint16,
+ DataType::Type::kInt16,
+ DataType::Type::kInt32,
+ DataType::Type::kInt64,
+ DataType::Type::kFloat32,
+ DataType::Type::kFloat64,
+};
+
/**
* Tests for the SideEffects class.
*/
@@ -91,9 +104,7 @@ TEST(SideEffectsTest, None) {
TEST(SideEffectsTest, DependencesAndNoDependences) {
// Apply test to each individual data type.
- for (DataType::Type type = DataType::Type::kReference;
- type < DataType::Type::kVoid;
- type = static_cast<DataType::Type>(static_cast<uint8_t>(type) + 1u)) {
+ for (DataType::Type type : kTestTypes) {
// Same data type and access type: proper write/read dep.
testWriteAndReadDependence(
SideEffects::FieldWriteOfType(type, false),
@@ -169,9 +180,7 @@ TEST(SideEffectsTest, SameWidthTypesNoAlias) {
TEST(SideEffectsTest, AllWritesAndReads) {
SideEffects s = SideEffects::None();
// Keep taking the union of different writes and reads.
- for (DataType::Type type = DataType::Type::kReference;
- type < DataType::Type::kVoid;
- type = static_cast<DataType::Type>(static_cast<uint8_t>(type) + 1u)) {
+ for (DataType::Type type : kTestTypes) {
s = s.Union(SideEffects::FieldWriteOfType(type, /* is_volatile */ false));
s = s.Union(SideEffects::ArrayWriteOfType(type));
s = s.Union(SideEffects::FieldReadOfType(type, /* is_volatile */ false));