diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2012-10-31 09:50:01 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2012-10-31 09:50:01 +0000 |
commit | 0ceb855d5251c67c3a129c172a520c1d2682c344 (patch) | |
tree | d5d434fbe00b2a350290930aca202bfea98e6aa2 /unittests | |
parent | 061938b90b1addc3c3269bdbfeae1029f0c05a43 (diff) |
Add IRBuilderBase::getIntPtrTy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167111 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/VMCore/IRBuilderTest.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/unittests/VMCore/IRBuilderTest.cpp b/unittests/VMCore/IRBuilderTest.cpp index b6a3795fd0..9f26936df4 100644 --- a/unittests/VMCore/IRBuilderTest.cpp +++ b/unittests/VMCore/IRBuilderTest.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "llvm/BasicBlock.h" +#include "llvm/DataLayout.h" #include "llvm/Function.h" #include "llvm/IRBuilder.h" #include "llvm/IntrinsicInst.h" @@ -96,4 +97,15 @@ TEST_F(IRBuilderTest, CreateCondBr) { EXPECT_EQ(Weights, TI->getMetadata(LLVMContext::MD_prof)); } +TEST_F(IRBuilderTest, GetIntTy) { + IRBuilder<> Builder(BB); + IntegerType *Ty1 = Builder.getInt1Ty(); + EXPECT_EQ(Ty1, IntegerType::get(getGlobalContext(), 1)); + + DataLayout* DL = new DataLayout(M.get()); + IntegerType *IntPtrTy = Builder.getIntPtrTy(DL); + unsigned IntPtrBitSize = DL->getPointerSizeInBits(0); + EXPECT_EQ(IntPtrTy, IntegerType::get(getGlobalContext(), IntPtrBitSize)); +} + } |