summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/Casting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support/Casting.cpp')
-rw-r--r--llvm/unittests/Support/Casting.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/unittests/Support/Casting.cpp b/llvm/unittests/Support/Casting.cpp
index 368ca17ef7c..bcdaca94a3c 100644
--- a/llvm/unittests/Support/Casting.cpp
+++ b/llvm/unittests/Support/Casting.cpp
@@ -118,6 +118,12 @@ TEST(CastingTest, isa) {
EXPECT_TRUE(isa<foo>(B4));
}
+TEST(CastingTest, isa_and_nonnull) {
+ EXPECT_TRUE(isa_and_nonnull<foo>(B2));
+ EXPECT_TRUE(isa_and_nonnull<foo>(B4));
+ EXPECT_FALSE(isa_and_nonnull<foo>(fub()));
+}
+
TEST(CastingTest, cast) {
foo &F1 = cast<foo>(B1);
EXPECT_NE(&F1, null_foo);
OpenPOWER on IntegriCloud