diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2009-08-07 19:54:29 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2009-08-07 19:54:29 +0000 |
commit | 6bf87df57935dff8bedaa23ccf5af1f3d1f2c1fb (patch) | |
tree | cf893da6a2280f96419b7672e9f4ae0dd6d0583c /llvm/unittests/Support | |
parent | b64ec07ea6f65dfbf33afa6fda6de4a6fa14e2a7 (diff) | |
download | bcm5719-llvm-6bf87df57935dff8bedaa23ccf5af1f3d1f2c1fb.tar.gz bcm5719-llvm-6bf87df57935dff8bedaa23ccf5af1f3d1f2c1fb.zip |
To catch bugs like the one fixed in
http://llvm.org/viewvc/llvm-project?view=rev&revision=78127, I'm changing the
ExecutionEngine's global mappings to hold AssertingVH<const GlobalValue>. That
way, if unregistering a mapping fails to actually unregister it, we'll get an
assert. Running the jit nightly tests didn't uncover any actual instances of
the problem.
This also uncovered the fact that AssertingVH<const X> didn't work, so I fixed
that too.
llvm-svn: 78400
Diffstat (limited to 'llvm/unittests/Support')
-rw-r--r-- | llvm/unittests/Support/ValueHandleTest.cpp | 7 |
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); |