Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/unittests/IR/MetadataTest.cpp
Show First 20 Lines • Show All 2,515 Lines • ▼ Show 20 Lines | TEST_F(DISubprogramTest, get) { | ||||
MDTuple *Annotations = getTuple(); | MDTuple *Annotations = getTuple(); | ||||
StringRef TargetFuncName = "target"; | StringRef TargetFuncName = "target"; | ||||
DICompileUnit *Unit = getUnit(); | DICompileUnit *Unit = getUnit(); | ||||
DISubprogram::DISPFlags SPFlags = | DISubprogram::DISPFlags SPFlags = | ||||
static_cast<DISubprogram::DISPFlags>(Virtuality); | static_cast<DISubprogram::DISPFlags>(Virtuality); | ||||
assert(!IsLocalToUnit && IsDefinition && !IsOptimized && | assert(!IsLocalToUnit && IsDefinition && !IsOptimized && | ||||
"bools and SPFlags have to match"); | "bools and SPFlags have to match"); | ||||
SPFlags |= DISubprogram::SPFlagDefinition; | SPFlags |= DISubprogram::SPFlagDefinition; | ||||
SPFlags |= DISubprogram::SPFlagIsDebugTrampoline; | |||||
auto *N = DISubprogram::get( | auto *N = DISubprogram::get( | ||||
Context, Scope, Name, LinkageName, File, Line, Type, ScopeLine, | Context, Scope, Name, LinkageName, File, Line, Type, ScopeLine, | ||||
ContainingType, VirtualIndex, ThisAdjustment, Flags, SPFlags, Unit, | ContainingType, VirtualIndex, ThisAdjustment, Flags, SPFlags, Unit, | ||||
TemplateParams, Declaration, RetainedNodes, ThrownTypes, Annotations, | TemplateParams, Declaration, RetainedNodes, ThrownTypes, Annotations, | ||||
TargetFuncName); | TargetFuncName); | ||||
EXPECT_EQ(dwarf::DW_TAG_subprogram, N->getTag()); | EXPECT_EQ(dwarf::DW_TAG_subprogram, N->getTag()); | ||||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | EXPECT_NE(N, DISubprogram::get( | ||||
TemplateParams, Declaration, RetainedNodes, ThrownTypes, | TemplateParams, Declaration, RetainedNodes, ThrownTypes, | ||||
Annotations, TargetFuncName)); | Annotations, TargetFuncName)); | ||||
EXPECT_NE(N, DISubprogram::get( | EXPECT_NE(N, DISubprogram::get( | ||||
Context, Scope, Name, LinkageName, File, Line, Type, | Context, Scope, Name, LinkageName, File, Line, Type, | ||||
ScopeLine, ContainingType, VirtualIndex, ThisAdjustment, | ScopeLine, ContainingType, VirtualIndex, ThisAdjustment, | ||||
Flags, SPFlags ^ DISubprogram::SPFlagDefinition, Unit, | Flags, SPFlags ^ DISubprogram::SPFlagDefinition, Unit, | ||||
TemplateParams, Declaration, RetainedNodes, ThrownTypes, | TemplateParams, Declaration, RetainedNodes, ThrownTypes, | ||||
Annotations, TargetFuncName)); | Annotations, TargetFuncName)); | ||||
EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line, | EXPECT_NE(N, DISubprogram::get( | ||||
Type, ScopeLine + 1, ContainingType, | Context, Scope, Name, LinkageName, File, Line, Type, | ||||
VirtualIndex, ThisAdjustment, Flags, SPFlags, | ScopeLine, ContainingType, VirtualIndex, ThisAdjustment, | ||||
Unit, TemplateParams, Declaration, | Flags, SPFlags ^ DISubprogram::SPFlagIsDebugTrampoline, | ||||
RetainedNodes, ThrownTypes, Annotations, | Unit, TemplateParams, Declaration, RetainedNodes, | ||||
TargetFuncName)); | ThrownTypes, Annotations, TargetFuncName)); | ||||
EXPECT_NE(N, DISubprogram::get( | |||||
Context, Scope, Name, LinkageName, File, Line, Type, | |||||
ScopeLine + 1, ContainingType, VirtualIndex, ThisAdjustment, | |||||
Flags, SPFlags, Unit, TemplateParams, Declaration, | |||||
RetainedNodes, ThrownTypes, Annotations, TargetFuncName)); | |||||
EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line, | EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line, | ||||
Type, ScopeLine, getCompositeType(), | Type, ScopeLine, getCompositeType(), | ||||
VirtualIndex, ThisAdjustment, Flags, SPFlags, | VirtualIndex, ThisAdjustment, Flags, SPFlags, | ||||
Unit, TemplateParams, Declaration, | Unit, TemplateParams, Declaration, | ||||
RetainedNodes, ThrownTypes, Annotations, | RetainedNodes, ThrownTypes, Annotations, | ||||
TargetFuncName)); | TargetFuncName)); | ||||
EXPECT_NE(N, DISubprogram::get( | EXPECT_NE(N, DISubprogram::get( | ||||
Context, Scope, Name, LinkageName, File, Line, Type, | Context, Scope, Name, LinkageName, File, Line, Type, | ||||
▲ Show 20 Lines • Show All 1,650 Lines • Show Last 20 Lines |