summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/ssa_test.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-06-09 14:06:02 +0100
committerNicolas Geoffray <ngeoffray@google.com>2014-06-09 14:06:02 +0100
commit184d640d2a3ac86d871dab58386a50cc9bb973f9 (patch)
tree4880a8790937e57de955b38cda06404f7a105a0f /compiler/optimizing/ssa_test.cc
parentfbc2b1747e7e3d06f214f801f53218a1d4bf2dbe (diff)
downloadart-184d640d2a3ac86d871dab58386a50cc9bb973f9.zip
art-184d640d2a3ac86d871dab58386a50cc9bb973f9.tar.gz
art-184d640d2a3ac86d871dab58386a50cc9bb973f9.tar.bz2
Add a type propagation phase after building SSA.
This ensures all phis have a type. Change-Id: I7e4f9a16d1efb5f64c493c1351749b352c870cbd
Diffstat (limited to 'compiler/optimizing/ssa_test.cc')
-rw-r--r--compiler/optimizing/ssa_test.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/optimizing/ssa_test.cc b/compiler/optimizing/ssa_test.cc
index 3b354f1..088a5c4 100644
--- a/compiler/optimizing/ssa_test.cc
+++ b/compiler/optimizing/ssa_test.cc
@@ -87,6 +87,13 @@ static void TestCode(const uint16_t* data, const char* expected) {
graph->TransformToSSA();
ReNumberInstructions(graph);
+ // Test that phis had their type set.
+ for (size_t i = 0, e = graph->GetBlocks().Size(); i < e; ++i) {
+ for (HInstructionIterator it(graph->GetBlocks().Get(i)->GetPhis()); !it.Done(); it.Advance()) {
+ ASSERT_NE(it.Current()->GetType(), Primitive::kPrimVoid);
+ }
+ }
+
SsaPrettyPrinter printer(graph);
printer.VisitInsertionOrder();