summaryrefslogtreecommitdiffstats
path: root/llvm/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests')
-rw-r--r--llvm/unittests/Support/ValueHandleTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/unittests/Support/ValueHandleTest.cpp b/llvm/unittests/Support/ValueHandleTest.cpp
index d9a5515f78e..5e6cd61035e 100644
--- a/llvm/unittests/Support/ValueHandleTest.cpp
+++ b/llvm/unittests/Support/ValueHandleTest.cpp
@@ -120,6 +120,13 @@ TEST_F(ValueHandle, AssertingVH_BasicOperation) {
EXPECT_FALSE((*AVH).mayWriteToMemory());
}
+TEST_F(ValueHandle, AssertingVH_Const) {
+ const CastInst *ConstBitcast = BitcastV.get();
+ AssertingVH<const CastInst> AVH(ConstBitcast);
+ const CastInst *implicit_to_exact_type = AVH;
+ implicit_to_exact_type = implicit_to_exact_type; // Avoid warning.
+}
+
TEST_F(ValueHandle, AssertingVH_Comparisons) {
AssertingVH<Value> BitcastAVH(BitcastV.get());
AssertingVH<Value> ConstantAVH(ConstantV);
OpenPOWER on IntegriCloud