Fix some of the memcheck errors found in the JIT unittests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95856 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jeffrey Yasskin
2010-02-11 06:41:30 +00:00
parent 8c5ad3a5da
commit 9233b15d01
5 changed files with 20 additions and 31 deletions

View File

@@ -18,14 +18,16 @@ namespace {
TEST(OpaqueTypeTest, RegisterWithContext) {
LLVMContext C;
LLVMContextImpl *pImpl = C.pImpl;
LLVMContextImpl *pImpl = C.pImpl;
EXPECT_EQ(0u, pImpl->OpaqueTypes.size());
// 1 refers to the AlwaysOpaqueTy allocated in the Context's constructor and
// destroyed in the destructor.
EXPECT_EQ(1u, pImpl->OpaqueTypes.size());
{
PATypeHolder Type = OpaqueType::get(C);
EXPECT_EQ(1u, pImpl->OpaqueTypes.size());
EXPECT_EQ(2u, pImpl->OpaqueTypes.size());
}
EXPECT_EQ(0u, pImpl->OpaqueTypes.size());
EXPECT_EQ(1u, pImpl->OpaqueTypes.size());
}
} // namespace