diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-04-29 00:14:27 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-04-29 00:14:27 +0000 |
commit | d24465f443cf37de82362c639a18619e797ff116 (patch) | |
tree | 86f6503627097d04985fa630e5075b1a9ce8a394 /llvm/unittests/ADT/PointerUnionTest.cpp | |
parent | 982a589d3a53dfb05130e469a3ad53ae4ee1193d (diff) | |
download | llvm-d24465f443cf37de82362c639a18619e797ff116.zip llvm-d24465f443cf37de82362c639a18619e797ff116.tar.gz llvm-d24465f443cf37de82362c639a18619e797ff116.tar.bz2 |
[ADT] Teach PointerUnion to support assignment directly from nullptr to
clear it out.
llvm-svn: 207471
Diffstat (limited to 'llvm/unittests/ADT/PointerUnionTest.cpp')
-rw-r--r-- | llvm/unittests/ADT/PointerUnionTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/PointerUnionTest.cpp b/llvm/unittests/ADT/PointerUnionTest.cpp index 23a8333..3bfb79c 100644 --- a/llvm/unittests/ADT/PointerUnionTest.cpp +++ b/llvm/unittests/ADT/PointerUnionTest.cpp @@ -46,6 +46,12 @@ TEST_F(PointerUnionTest, Null) { EXPECT_TRUE((bool)a); EXPECT_TRUE((bool)b); EXPECT_FALSE(n); + + EXPECT_NE(n, b); + EXPECT_EQ(b, c); + b = nullptr; + EXPECT_EQ(n, b); + EXPECT_NE(b, c); } TEST_F(PointerUnionTest, Is) { |