Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: test/cctest/test-types.cc

Issue 300893003: Refactor HType to get rid of various hacks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix compilation. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-hydrogen-types.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-types.cc
diff --git a/test/cctest/test-types.cc b/test/cctest/test-types.cc
index 21e3df8f9a6d793b909a81d91e853e9ee723dba9..41863bc7ffde4a768607f3d2e95c817a0f81c2db 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"
@@ -1776,6 +1777,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;
@@ -1920,3 +1933,10 @@ TEST(Convert) {
ZoneTests().Convert<HeapType, Handle<HeapType>, Isolate, HeapRep>();
HeapTests().Convert<Type, Type*, Zone, ZoneRep>();
}
+
+
+TEST(HTypeFromType) {
+ CcTest::InitializeVM();
+ ZoneTests().HTypeFromType();
+ HeapTests().HTypeFromType();
+}
« no previous file with comments | « test/cctest/test-hydrogen-types.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698