summaryrefslogtreecommitdiff
path: root/test/gtest/possible-contents.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/gtest/possible-contents.cpp')
-rw-r--r--test/gtest/possible-contents.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/gtest/possible-contents.cpp b/test/gtest/possible-contents.cpp
index 04c288806..7b8f0c4a8 100644
--- a/test/gtest/possible-contents.cpp
+++ b/test/gtest/possible-contents.cpp
@@ -481,6 +481,8 @@ void assertIntersection(PossibleContents a,
auto intersection = a;
intersection.intersectWithFullCone(b);
EXPECT_EQ(intersection, result);
+
+ EXPECT_EQ(PossibleContents::haveIntersection(a, b), !result.isNone());
}
TEST_F(PossibleContentsTest, TestStructCones) {
@@ -713,6 +715,13 @@ TEST_F(PossibleContentsTest, TestStructCones) {
assertIntersection(nnExactA, PossibleContents::fullConeType(nullB), none);
assertIntersection(exactA, PossibleContents::fullConeType(nnB), none);
+ // A and E have no intersection, so the only possibility is a null, and that
+ // null must be the bottom type.
+ assertIntersection(
+ exactA,
+ PossibleContents::fullConeType(nullE),
+ PossibleContents::literal(Literal::makeNull(HeapType::none)));
+
assertIntersection(PossibleContents::coneType(nnA, 1),
PossibleContents::fullConeType(nnB),
nnExactB);