summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/IR
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/IR')
-rw-r--r--llvm/unittests/IR/DebugInfoTest.cpp6
-rw-r--r--llvm/unittests/IR/DebugTypeODRUniquingTest.cpp25
-rw-r--r--llvm/unittests/IR/IRBuilderTest.cpp10
-rw-r--r--llvm/unittests/IR/MetadataTest.cpp39
4 files changed, 40 insertions, 40 deletions
diff --git a/llvm/unittests/IR/DebugInfoTest.cpp b/llvm/unittests/IR/DebugInfoTest.cpp
index f8175fa6052..a80df3c54fd 100644
--- a/llvm/unittests/IR/DebugInfoTest.cpp
+++ b/llvm/unittests/IR/DebugInfoTest.cpp
@@ -71,9 +71,11 @@ TEST(DINodeTest, splitFlags) {
CHECK_SPLIT(DINode::FlagProtected, {DINode::FlagProtected}, DINode::FlagZero);
CHECK_SPLIT(DINode::FlagPrivate, {DINode::FlagPrivate}, DINode::FlagZero);
CHECK_SPLIT(DINode::FlagVector, {DINode::FlagVector}, DINode::FlagZero);
- CHECK_SPLIT(DINode::FlagRValueReference, {DINode::FlagRValueReference}, DINode::FlagZero);
+ CHECK_SPLIT(DINode::FlagRValueReference, {DINode::FlagRValueReference},
+ DINode::FlagZero);
DINode::DIFlags Flags[] = {DINode::FlagFwdDecl, DINode::FlagVector};
- CHECK_SPLIT(DINode::FlagFwdDecl | DINode::FlagVector, Flags, DINode::FlagZero);
+ CHECK_SPLIT(DINode::FlagFwdDecl | DINode::FlagVector, Flags,
+ DINode::FlagZero);
CHECK_SPLIT(DINode::FlagZero, {}, DINode::FlagZero);
#undef CHECK_SPLIT
}
diff --git a/llvm/unittests/IR/DebugTypeODRUniquingTest.cpp b/llvm/unittests/IR/DebugTypeODRUniquingTest.cpp
index 2133d8236ad..7cf1cd22a2f 100644
--- a/llvm/unittests/IR/DebugTypeODRUniquingTest.cpp
+++ b/llvm/unittests/IR/DebugTypeODRUniquingTest.cpp
@@ -44,16 +44,15 @@ TEST(DebugTypeODRUniquingTest, getODRType) {
// Check that we get it back, even if we change a field.
EXPECT_EQ(&CT, DICompositeType::getODRTypeIfExists(Context, UUID));
- EXPECT_EQ(
- &CT, DICompositeType::getODRType(Context, UUID, dwarf::DW_TAG_class_type,
- nullptr, nullptr, 0, nullptr, nullptr, 0,
- 0, 0, DINode::FlagZero, nullptr, 0,
- nullptr, nullptr));
EXPECT_EQ(&CT, DICompositeType::getODRType(
- Context, UUID, dwarf::DW_TAG_class_type,
- MDString::get(Context, "name"), nullptr, 0, nullptr,
- nullptr, 0, 0, 0, DINode::FlagZero, nullptr, 0,
+ Context, UUID, dwarf::DW_TAG_class_type, nullptr, nullptr,
+ 0, nullptr, nullptr, 0, 0, 0, DINode::FlagZero, nullptr, 0,
nullptr, nullptr));
+ EXPECT_EQ(&CT,
+ DICompositeType::getODRType(
+ Context, UUID, dwarf::DW_TAG_class_type,
+ MDString::get(Context, "name"), nullptr, 0, nullptr, nullptr, 0,
+ 0, 0, DINode::FlagZero, nullptr, 0, nullptr, nullptr));
// Check that it's discarded with the type map.
Context.disableDebugTypeODRUniquing();
@@ -84,8 +83,9 @@ TEST(DebugTypeODRUniquingTest, buildODRType) {
// Update with a definition. This time we should see a change.
EXPECT_EQ(&CT, DICompositeType::buildODRType(
- Context, UUID, dwarf::DW_TAG_structure_type, nullptr, nullptr, 0, nullptr,
- nullptr, 0, 0, 0, DINode::FlagZero, nullptr, 0, nullptr, nullptr));
+ Context, UUID, dwarf::DW_TAG_structure_type, nullptr,
+ nullptr, 0, nullptr, nullptr, 0, 0, 0, DINode::FlagZero,
+ nullptr, 0, nullptr, nullptr));
EXPECT_EQ(dwarf::DW_TAG_structure_type, CT.getTag());
// Further updates should be ignored.
@@ -94,8 +94,9 @@ TEST(DebugTypeODRUniquingTest, buildODRType) {
nullptr, 0, 0, 0, DINode::FlagFwdDecl, nullptr, 0, nullptr, nullptr));
EXPECT_EQ(dwarf::DW_TAG_structure_type, CT.getTag());
EXPECT_EQ(&CT, DICompositeType::buildODRType(
- Context, UUID, dwarf::DW_TAG_class_type, nullptr, nullptr, 0, nullptr,
- nullptr, 0, 0, 0, DINode::FlagZero, nullptr, 0, nullptr, nullptr));
+ Context, UUID, dwarf::DW_TAG_class_type, nullptr, nullptr,
+ 0, nullptr, nullptr, 0, 0, 0, DINode::FlagZero, nullptr, 0,
+ nullptr, nullptr));
EXPECT_EQ(dwarf::DW_TAG_structure_type, CT.getTag());
}
diff --git a/llvm/unittests/IR/IRBuilderTest.cpp b/llvm/unittests/IR/IRBuilderTest.cpp
index 0affe112618..01423a5b412 100644
--- a/llvm/unittests/IR/IRBuilderTest.cpp
+++ b/llvm/unittests/IR/IRBuilderTest.cpp
@@ -343,14 +343,12 @@ TEST_F(IRBuilderTest, DIBuilder) {
auto CU = DIB.createCompileUnit(dwarf::DW_LANG_Cobol74, "F.CBL", "/",
"llvm-cobol74", true, "", 0);
auto Type = DIB.createSubroutineType(DIB.getOrCreateTypeArray(None));
- auto SP =
- DIB.createFunction(CU, "foo", "", File, 1, Type, false, true, 1,
- DINode::FlagZero, true);
+ auto SP = DIB.createFunction(CU, "foo", "", File, 1, Type, false, true, 1,
+ DINode::FlagZero, true);
F->setSubprogram(SP);
AllocaInst *I = Builder.CreateAlloca(Builder.getInt8Ty());
- auto BarSP =
- DIB.createFunction(CU, "bar", "", File, 1, Type, false, true, 1,
- DINode::FlagZero, true);
+ auto BarSP = DIB.createFunction(CU, "bar", "", File, 1, Type, false, true, 1,
+ DINode::FlagZero, true);
auto BadScope = DIB.createLexicalBlockFile(BarSP, File, 0);
I->setDebugLoc(DebugLoc::get(2, 0, BadScope));
DIB.finalize();
diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp
index 959740df0ce..def2ddee262 100644
--- a/llvm/unittests/IR/MetadataTest.cpp
+++ b/llvm/unittests/IR/MetadataTest.cpp
@@ -80,13 +80,13 @@ protected:
MDTuple *getTuple() { return MDTuple::getDistinct(Context, None); }
DISubroutineType *getSubroutineType() {
- return DISubroutineType::getDistinct(Context, DINode::FlagZero,
- 0, getNode(nullptr));
+ return DISubroutineType::getDistinct(Context, DINode::FlagZero, 0,
+ getNode(nullptr));
}
DISubprogram *getSubprogram() {
return DISubprogram::getDistinct(Context, nullptr, "", "", nullptr, 0,
- nullptr, false, false, 0, nullptr,
- 0, 0, 0, DINode::FlagZero, false, nullptr);
+ nullptr, false, false, 0, nullptr, 0, 0, 0,
+ DINode::FlagZero, false, nullptr);
}
DIFile *getFile() {
return DIFile::getDistinct(Context, "file.c", "/path/to/dir");
@@ -101,10 +101,9 @@ protected:
return DIBasicType::get(Context, dwarf::DW_TAG_unspecified_type, Name);
}
DIType *getDerivedType() {
- return DIDerivedType::getDistinct(Context, dwarf::DW_TAG_pointer_type, "",
- nullptr, 0, nullptr,
- getBasicType("basictype"),
- 1, 2, 0, DINode::FlagZero);
+ return DIDerivedType::getDistinct(
+ Context, dwarf::DW_TAG_pointer_type, "", nullptr, 0, nullptr,
+ getBasicType("basictype"), 1, 2, 0, DINode::FlagZero);
}
Constant *getConstant() {
return ConstantInt::get(Type::getInt32Ty(Context), Counter++);
@@ -1030,16 +1029,16 @@ TEST_F(DITypeTest, setFlags) {
Metadata *TypesOps[] = {nullptr};
Metadata *Types = MDTuple::get(Context, TypesOps);
- DIType *D = DISubroutineType::getDistinct(Context, DINode::FlagZero,
- 0, Types);
+ DIType *D =
+ DISubroutineType::getDistinct(Context, DINode::FlagZero, 0, Types);
EXPECT_EQ(DINode::FlagZero, D->getFlags());
D->setFlags(DINode::FlagRValueReference);
EXPECT_EQ(DINode::FlagRValueReference, D->getFlags());
D->setFlags(DINode::FlagZero);
EXPECT_EQ(DINode::FlagZero, D->getFlags());
- TempDIType T = DISubroutineType::getTemporary(Context, DINode::FlagZero,
- 0, Types);
+ TempDIType T =
+ DISubroutineType::getTemporary(Context, DINode::FlagZero, 0, Types);
EXPECT_EQ(DINode::FlagZero, T->getFlags());
T->setFlags(DINode::FlagRValueReference);
EXPECT_EQ(DINode::FlagRValueReference, T->getFlags());
@@ -1057,9 +1056,9 @@ TEST_F(DIDerivedTypeTest, get) {
DINode::DIFlags Flags5 = static_cast<DINode::DIFlags>(5);
DINode::DIFlags Flags4 = static_cast<DINode::DIFlags>(4);
- auto *N = DIDerivedType::get(Context, dwarf::DW_TAG_pointer_type, "something",
- File, 1, Scope, BaseType, 2, 3, 4,
- Flags5, ExtraData);
+ auto *N =
+ DIDerivedType::get(Context, dwarf::DW_TAG_pointer_type, "something", File,
+ 1, Scope, BaseType, 2, 3, 4, Flags5, ExtraData);
EXPECT_EQ(dwarf::DW_TAG_pointer_type, N->getTag());
EXPECT_EQ("something", N->getName());
EXPECT_EQ(File, N->getFile());
@@ -1079,8 +1078,8 @@ TEST_F(DIDerivedTypeTest, get) {
"something", File, 1, Scope, BaseType, 2, 3,
4, Flags5, ExtraData));
EXPECT_NE(N, DIDerivedType::get(Context, dwarf::DW_TAG_pointer_type, "else",
- File, 1, Scope, BaseType, 2, 3, 4,
- Flags5, ExtraData));
+ File, 1, Scope, BaseType, 2, 3, 4, Flags5,
+ ExtraData));
EXPECT_NE(N, DIDerivedType::get(Context, dwarf::DW_TAG_pointer_type,
"something", getFile(), 1, Scope, BaseType, 2,
3, 4, Flags5, ExtraData));
@@ -1120,9 +1119,9 @@ TEST_F(DIDerivedTypeTest, getWithLargeValues) {
MDTuple *ExtraData = getTuple();
DINode::DIFlags Flags = static_cast<DINode::DIFlags>(5);
- auto *N = DIDerivedType::get(Context, dwarf::DW_TAG_pointer_type, "something",
- File, 1, Scope, BaseType, UINT64_MAX,
- UINT64_MAX - 1, UINT64_MAX - 2, Flags, ExtraData);
+ auto *N = DIDerivedType::get(
+ Context, dwarf::DW_TAG_pointer_type, "something", File, 1, Scope,
+ BaseType, UINT64_MAX, UINT64_MAX - 1, UINT64_MAX - 2, Flags, ExtraData);
EXPECT_EQ(UINT64_MAX, N->getSizeInBits());
EXPECT_EQ(UINT64_MAX - 1, N->getAlignInBits());
EXPECT_EQ(UINT64_MAX - 2, N->getOffsetInBits());
OpenPOWER on IntegriCloud