Fix GDB printers test

- Prevent symbols from being stripped so that it can run with 'RelWithDebInfo'.
- Adjust llvm-support CHECKs after code changes.
- Polish mlir-support CHECKs as suggested in https://reviews.llvm.org/D116646.

Differential Revision: https://reviews.llvm.org/D116837
This commit is contained in:
Christian Sigg 2022-01-07 22:44:41 +01:00
parent 3e9919cf57
commit fb4869e26c
4 changed files with 71 additions and 57 deletions

View File

@ -61,12 +61,15 @@ auto SimpleIlist = []() {
}(); }();
int main() { int main() {
// Reference symbols that might otherwise be stripped. std::uintptr_t result = 0;
ArrayRef[0]; auto dont_strip = [&](const auto &val) {
MutableArrayRef[0]; result += reinterpret_cast<std::uintptr_t>(&val);
(void)!ExpectedValue; };
(void)!ExpectedError; dont_strip(ArrayRef);
*OptionalValue; dont_strip(MutableArrayRef);
*OptionalNone; dont_strip(ExpectedValue);
return 0; dont_strip(ExpectedError);
dont_strip(OptionalValue);
dont_strip(OptionalNone);
return result; // Non-zero return value is OK.
} }

View File

@ -64,7 +64,7 @@ set print pretty
# CHECK: }, # CHECK: },
# CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = { # CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = {
# CHECK: prev = [[Node_14]], # CHECK: prev = [[Node_14]],
# CHECK: next = [[SimpleIlist_Sentinel:0x.*]] <SimpleIlist> # CHECK: next = [[SimpleIlist_Sentinel:0x.*]] <completed>
# CHECK: }, # CHECK: },
# CHECK: members of IlistNode: # CHECK: members of IlistNode:
# CHECK: Value = 13 # CHECK: Value = 13
@ -87,7 +87,7 @@ set print pretty
# CHECK: next = [[Ilist_Sentinel]] <Ilist> # CHECK: next = [[Ilist_Sentinel]] <Ilist>
# CHECK: }, # CHECK: },
# CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = { # CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = {
# CHECK: prev = [[SimpleIlist_Sentinel]] <SimpleIlist>, # CHECK: prev = [[SimpleIlist_Sentinel]] <completed>,
# CHECK: next = [[Node_14]] # CHECK: next = [[Node_14]]
# CHECK: }, # CHECK: },
# CHECK: members of IlistNode: # CHECK: members of IlistNode:
@ -103,7 +103,7 @@ p Ilist
# CHECK: next = [[Ilist_Sentinel]] <Ilist> # CHECK: next = [[Ilist_Sentinel]] <Ilist>
# CHECK: }, # CHECK: },
# CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = { # CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = {
# CHECK: prev = [[SimpleIlist_Sentinel]] <SimpleIlist>, # CHECK: prev = [[SimpleIlist_Sentinel]] <completed>,
# CHECK: next = [[Node_14]] # CHECK: next = [[Node_14]]
# CHECK: }, # CHECK: },
# CHECK: members of IlistNode: # CHECK: members of IlistNode:
@ -128,7 +128,7 @@ p Ilist
# CHECK: }, # CHECK: },
# CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = { # CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = {
# CHECK: prev = [[Node_14]], # CHECK: prev = [[Node_14]],
# CHECK: next = [[SimpleIlist_Sentinel]] <SimpleIlist> # CHECK: next = [[SimpleIlist_Sentinel]] <completed>
# CHECK: }, # CHECK: },
# CHECK: members of IlistNode: # CHECK: members of IlistNode:
# CHECK: Value = 13 # CHECK: Value = 13

View File

@ -41,4 +41,12 @@ mlir::Attribute StringAttr = mlir::StringAttr::get(&Context, "foo");
mlir::Attribute ElementsAttr = mlir::DenseElementsAttr::get( mlir::Attribute ElementsAttr = mlir::DenseElementsAttr::get(
VectorType.cast<mlir::ShapedType>(), llvm::ArrayRef<float>{2.0f, 3.0f}); VectorType.cast<mlir::ShapedType>(), llvm::ArrayRef<float>{2.0f, 3.0f});
int main() { return 0; } int main() {
// Reference symbols that might otherwise be stripped.
std::uintptr_t result = 0;
auto dont_strip = [&](const auto &val) {
result += reinterpret_cast<std::uintptr_t>(&val);
};
dont_strip(Value);
return result; // Non-zero return value is OK.
}

View File

@ -24,121 +24,124 @@ print Type
# CHECK-LABEL: +print IndexType # CHECK-LABEL: +print IndexType
print IndexType print IndexType
# CHECK: mlir::IndexType # CHECK: typeID = mlir::TypeID::get<mlir::IndexType>()
# CHECK-LABEL: +print IntegerType # CHECK-LABEL: +print IntegerType
print IntegerType print IntegerType
# CHECK: mlir::IntegerType # CHECK: typeID = mlir::TypeID::get<mlir::IntegerType>()
# CHECK: width = 3 # CHECK: members of mlir::detail::IntegerTypeStorage
# CHECK: Unsigned
# CHECK-LABEL: +print FloatType # CHECK-LABEL: +print FloatType
print FloatType print FloatType
# CHECK: mlir::Float32Type # CHECK: typeID = mlir::TypeID::get<mlir::Float32Type>()
# CHECK-LABEL: +print MemRefType # CHECK-LABEL: +print MemRefType
print MemRefType print MemRefType
# CHECK: mlir::MemRefType # CHECK: typeID = mlir::TypeID::get<mlir::MemRefType>()
# CHECK: shape = llvm::ArrayRef of length 2 = {4, 5} # CHECK: members of mlir::detail::MemRefTypeStorage
# CHECK: elementType
# CHECK: mlir::Float32Type
# CHECK-LABEL: +print UnrankedMemRefType # CHECK-LABEL: +print UnrankedMemRefType
print UnrankedMemRefType print UnrankedMemRefType
# CHECK: mlir::UnrankedMemRefType # CHECK: typeID = mlir::TypeID::get<mlir::UnrankedMemRefType>()
# CHECK: elementType # CHECK: members of mlir::detail::UnrankedMemRefTypeStorage
# CHECK: mlir::IntegerType
# CHECK: memorySpace
# CHECK: 6
# CHECK-LABEL: +print VectorType # CHECK-LABEL: +print VectorType
print VectorType print VectorType
# CHECK: mlir::VectorType # CHECK: typeID = mlir::TypeID::get<mlir::VectorType>()
# CHECK: shape = llvm::ArrayRef of length 2 = {1, 2} # CHECK: members of mlir::detail::VectorTypeStorage
# CHECK-LABEL: +print TupleType # CHECK-LABEL: +print TupleType
print TupleType print TupleType
# CHECK: mlir::TupleType # CHECK: typeID = mlir::TypeID::get<mlir::TupleType>()
# CHECK: numElements = 2
# CHECK: elements[0] # CHECK: elements[0]
# CHECK: mlir::IndexType # CHECK-NEXT: typeID = mlir::TypeID::get<mlir::IndexType>()
# CHECK: elements[1] # CHECK: elements[1]
# CHECK: mlir::Float32Type # CHECK-NEXT: typeID = mlir::TypeID::get<mlir::Float32Type>()
# CHECK-LABEL: +print Result # CHECK-LABEL: +print Result
print Result print Result
# CHECK: mlir::Float32Type # CHECK: typeID = mlir::TypeID::get<mlir::Float32Type>()
# CHECK: outOfLineIndex = 42 # CHECK: outOfLineIndex = 42
# CHECK-LABEL: +print Value # CHECK-LABEL: +print Value
print Value print Value
# CHECK: OutOfLineOpResult # CHECK: typeID = mlir::TypeID::get<mlir::Float32Type>()
# CHECK: mlir::detail::ValueImpl::Kind::OutOfLineOpResult
# CHECK-LABEL: +print UnknownLoc # CHECK-LABEL: +print UnknownLoc
print UnknownLoc print UnknownLoc
# CHECK: mlir::UnknownLoc # CHECK: typeID = mlir::TypeID::get<mlir::UnknownLoc>()
# CHECK-LABEL: +print FileLineColLoc # CHECK-LABEL: +print FileLineColLoc
print FileLineColLoc print FileLineColLoc
# CHECK: mlir::FileLineColLoc # CHECK: typeID = mlir::TypeID::get<mlir::FileLineColLoc>()
# CHECK: members of mlir::detail::FileLineColLocAttrStorage
# CHECK: "file" # CHECK: "file"
# CHECK: line = 7 # CHECK: line = 7
# CHECK: column = 8 # CHECK: column = 8
# CHECK-LABEL: +print OpaqueLoc # CHECK-LABEL: +print OpaqueLoc
print OpaqueLoc print OpaqueLoc
# CHECK: mlir::OpaqueLoc # CHECK: typeID = mlir::TypeID::get<mlir::OpaqueLoc>()
# CHECK: members of mlir::detail::OpaqueLocAttrStorage
# CHECK: underlyingLocation = 9 # CHECK: underlyingLocation = 9
# CHECK-LABEL: +print NameLoc # CHECK-LABEL: +print NameLoc
print NameLoc print NameLoc
# CHECK: mlir::NameLoc # CHECK: typeID = mlir::TypeID::get<mlir::NameLoc>()
# CHECK: members of mlir::detail::NameLocAttrStorage
# CHECK: "foo" # CHECK: "foo"
# CHECK: mlir::UnknownLoc # CHECK: typeID = mlir::TypeID::get<mlir::UnknownLoc>()
# CHECK-LABEL: +print CallSiteLoc # CHECK-LABEL: +print CallSiteLoc
print CallSiteLoc print CallSiteLoc
# CHECK: mlir::CallSiteLoc # CHECK: typeID = mlir::TypeID::get<mlir::CallSiteLoc>()
# CHECK: callee # CHECK: members of mlir::detail::CallSiteLocAttrStorage
# CHECK: mlir::FileLineColLoc # CHECK: typeID = mlir::TypeID::get<mlir::FileLineColLoc>()
# CHECK: caller # CHECK: typeID = mlir::TypeID::get<mlir::OpaqueLoc>()
# CHECK: mlir::OpaqueLoc
# CHECK-LABEL: +print FusedLoc # CHECK-LABEL: +print FusedLoc
print FusedLoc print FusedLoc
# CHECK: mlir::FusedLoc # CHECK: typeID = mlir::TypeID::get<mlir::FusedLoc>()
# CHECK: members of mlir::detail::FusedLocAttrStorage
# CHECK: locations = llvm::ArrayRef of length 2 # CHECK: locations = llvm::ArrayRef of length 2
# CHECK: mlir::FileLineColLoc # CHECK: typeID = mlir::TypeID::get<mlir::FileLineColLoc>()
# CHECK: mlir::NameLoc # CHECK: typeID = mlir::TypeID::get<mlir::NameLoc>()
# CHECK-LABEL: +print UnitAttr # CHECK-LABEL: +print UnitAttr
print UnitAttr print UnitAttr
# CHECK: mlir::UnitAttr # CHECK: typeID = mlir::TypeID::get<mlir::UnitAttr>()
# CHECK-LABEL: +print FloatAttr # CHECK-LABEL: +print FloatAttr
print FloatAttr print FloatAttr
# CHECK: mlir::FloatAttr # CHECK: typeID = mlir::TypeID::get<mlir::FloatAttr>()
# CHECK: members of mlir::detail::FloatAttrStorage
# CHECK-LABEL: +print IntegerAttr # CHECK-LABEL: +print IntegerAttr
print IntegerAttr print IntegerAttr
# CHECK: mlir::IntegerAttr # CHECK: typeID = mlir::TypeID::get<mlir::IntegerAttr>()
# CHECK: members of mlir::detail::IntegerAttrStorage
# CHECK-LABEL: +print TypeAttr # CHECK-LABEL: +print TypeAttr
print TypeAttr print TypeAttr
# CHECK: mlir::TypeAttr # CHECK: typeID = mlir::TypeID::get<mlir::TypeAttr>()
# CHECK: mlir::IndexType # CHECK: members of mlir::detail::TypeAttrStorage
# CHECK: typeID = mlir::TypeID::get<mlir::IndexType>()
# CHECK-LABEL: +print ArrayAttr # CHECK-LABEL: +print ArrayAttr
print ArrayAttr print ArrayAttr
# CHECK: mlir::ArrayAttr # CHECK: typeID = mlir::TypeID::get<mlir::ArrayAttr>()
# CHECK: members of mlir::detail::ArrayAttrStorage
# CHECK: llvm::ArrayRef of length 1 # CHECK: llvm::ArrayRef of length 1
# CHECK: mlir::UnitAttr # CHECK: typeID = mlir::TypeID::get<mlir::UnitAttr>()
# CHECK-LABEL: +print StringAttr # CHECK-LABEL: +print StringAttr
print StringAttr print StringAttr
# CHECK: mlir::StringAttr # CHECK: typeID = mlir::TypeID::get<mlir::StringAttr>()
# CHECK: members of mlir::detail::StringAttrStorage
# CHECK: value = "foo" # CHECK: value = "foo"
# CHECK-LABEL: +print ElementsAttr # CHECK-LABEL: +print ElementsAttr
print ElementsAttr print ElementsAttr
# CHECK: mlir::DenseIntOrFPElementsAttr # CHECK: typeID = mlir::TypeID::get<mlir::DenseIntOrFPElementsAttr>()
# CHECK: members of mlir::detail::DenseIntOrFPElementsAttrStorage