summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'unittests')
-rw-r--r--unittests/IR/IRBuilderTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/unittests/IR/IRBuilderTest.cpp b/unittests/IR/IRBuilderTest.cpp
index a0a72e82ed..e6db8c66df 100644
--- a/unittests/IR/IRBuilderTest.cpp
+++ b/unittests/IR/IRBuilderTest.cpp
@@ -108,6 +108,14 @@ TEST_F(IRBuilderTest, LandingPadName) {
EXPECT_EQ(LP->getName(), "LP");
}
+TEST_F(IRBuilderTest, DataLayout) {
+ OwningPtr<Module> M(new Module("test", Ctx));
+ M->setDataLayout("e-n32");
+ EXPECT_TRUE(M->getDataLayout()->isLegalInteger(32));
+ M->setDataLayout("e");
+ EXPECT_FALSE(M->getDataLayout()->isLegalInteger(32));
+}
+
TEST_F(IRBuilderTest, GetIntTy) {
IRBuilder<> Builder(BB);
IntegerType *Ty1 = Builder.getInt1Ty();