Index: test/cctest/test-heap.cc |
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc |
index d7c24156a3d2aed5fad23b591898cf7e510f4902..5ddbc99fea932c4a65e6ac40946cc67da05541c6 100644 |
--- a/test/cctest/test-heap.cc |
+++ b/test/cctest/test-heap.cc |
@@ -5092,3 +5092,14 @@ TEST(PathTracer) { |
CcTest::i_isolate()->heap()->TracePathToObject(*o); |
} |
#endif // DEBUG |
+ |
+ |
+TEST(WritableVsImmortalRoots) { |
+ for (int i = 0; i < Heap::kStrongRootListLength; ++i) { |
+ Heap::RootListIndex root_index = static_cast<Heap::RootListIndex>(i); |
+ bool writable = Heap::RootCanBeWrittenAfterInitialization(root_index); |
+ bool immortal = Heap::RootIsImmortalImmovable(root_index); |
+ // A root value can be writable, immortal, or neither, but not both. |
+ CHECK(!immortal || !writable); |
+ } |
+} |