Index: test/cctest/test-types.cc |
diff --git a/test/cctest/test-types.cc b/test/cctest/test-types.cc |
index d2f9b9a004b9fc5c7a8a8cc7bb3d4708c04398ad..97a022bbeeea66dc4d6424b41e9474178777b399 100644 |
--- a/test/cctest/test-types.cc |
+++ b/test/cctest/test-types.cc |
@@ -28,6 +28,7 @@ |
#include <vector> |
#include "cctest.h" |
+#include "hydrogen-types.h" |
#include "types.h" |
#include "utils/random-number-generator.h" |
@@ -1774,6 +1775,18 @@ struct Tests : Rep { |
CheckEqual(type1, type3); |
} |
} |
+ |
+ void HTypeFromType() { |
+ for (TypeIterator it1 = T.types.begin(); it1 != T.types.end(); ++it1) { |
+ for (TypeIterator it2 = T.types.begin(); it2 != T.types.end(); ++it2) { |
+ TypeHandle type1 = *it1; |
+ TypeHandle type2 = *it2; |
+ HType htype1 = HType::FromType<Type>(type1); |
+ HType htype2 = HType::FromType<Type>(type2); |
+ CHECK(!type1->Is(type2) || htype1.IsSubtypeOf(htype2)); |
+ } |
+ } |
+ } |
}; |
typedef Tests<Type, Type*, Zone, ZoneRep> ZoneTests; |
@@ -1911,3 +1924,10 @@ TEST(Convert) { |
ZoneTests().Convert<HeapType, Handle<HeapType>, Isolate, HeapRep>(); |
HeapTests().Convert<Type, Type*, Zone, ZoneRep>(); |
} |
+ |
+ |
+TEST(HTypeFromType) { |
+ CcTest::InitializeVM(); |
+ ZoneTests().HTypeFromType(); |
+ HeapTests().HTypeFromType(); |
+} |