aboutsummaryrefslogtreecommitdiffstats
path: root/unittests/VMCore/DerivedTypesTest.cpp
blob: 11b4dffb5f471ff6aedbc2c9e427ca6c86b72248 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//===- llvm/unittest/VMCore/DerivedTypesTest.cpp - Types unit tests -------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "gtest/gtest.h"
#include "../lib/VMCore/LLVMContextImpl.h"
#include "llvm/Type.h"
#include "llvm/DerivedTypes.h"
#include "llvm/LLVMContext.h"
using namespace llvm;

namespace {

TEST(OpaqueTypeTest, RegisterWithContext) {
  LLVMContext C;
  LLVMContextImpl *pImpl = C.pImpl;  

  EXPECT_EQ(0u, pImpl->OpaqueTypes.size());
  {
    PATypeHolder Type = OpaqueType::get(C);
    EXPECT_EQ(1u, pImpl->OpaqueTypes.size());
  }
  EXPECT_EQ(0u, pImpl->OpaqueTypes.size());
}

}  // namespace