diff --git a/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/llvm-support.cpp b/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/llvm-support.cpp --- a/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/llvm-support.cpp +++ b/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/llvm-support.cpp @@ -61,12 +61,15 @@ }(); int main() { - // Reference symbols that might otherwise be stripped. - ArrayRef[0]; - MutableArrayRef[0]; - (void)!ExpectedValue; - (void)!ExpectedError; - *OptionalValue; - *OptionalNone; - return 0; + std::uintptr_t result = 0; + auto dont_strip = [&](const auto &val) { + result += reinterpret_cast(&val); + }; + dont_strip(ArrayRef); + dont_strip(MutableArrayRef); + dont_strip(ExpectedValue); + dont_strip(ExpectedError); + dont_strip(OptionalValue); + dont_strip(OptionalNone); + return result; // Non-zero return value is OK. } diff --git a/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/llvm-support.gdb b/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/llvm-support.gdb --- a/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/llvm-support.gdb +++ b/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/llvm-support.gdb @@ -64,7 +64,7 @@ # CHECK: }, # CHECK: >> = { # CHECK: prev = [[Node_14]], -# CHECK: next = [[SimpleIlist_Sentinel:0x.*]] +# CHECK: next = [[SimpleIlist_Sentinel:0x.*]] # CHECK: }, # CHECK: members of IlistNode: # CHECK: Value = 13 @@ -87,7 +87,7 @@ # CHECK: next = [[Ilist_Sentinel]] # CHECK: }, # CHECK: >> = { -# CHECK: prev = [[SimpleIlist_Sentinel]] , +# CHECK: prev = [[SimpleIlist_Sentinel]] , # CHECK: next = [[Node_14]] # CHECK: }, # CHECK: members of IlistNode: @@ -103,7 +103,7 @@ # CHECK: next = [[Ilist_Sentinel]] # CHECK: }, # CHECK: >> = { -# CHECK: prev = [[SimpleIlist_Sentinel]] , +# CHECK: prev = [[SimpleIlist_Sentinel]] , # CHECK: next = [[Node_14]] # CHECK: }, # CHECK: members of IlistNode: @@ -128,7 +128,7 @@ # CHECK: }, # CHECK: >> = { # CHECK: prev = [[Node_14]], -# CHECK: next = [[SimpleIlist_Sentinel]] +# CHECK: next = [[SimpleIlist_Sentinel]] # CHECK: }, # CHECK: members of IlistNode: # CHECK: Value = 13 diff --git a/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp b/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp --- a/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp +++ b/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp @@ -41,4 +41,12 @@ mlir::Attribute ElementsAttr = mlir::DenseElementsAttr::get( VectorType.cast(), llvm::ArrayRef{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(&val); + }; + dont_strip(Value); + return result; // Non-zero return value is OK. +} diff --git a/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.gdb b/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.gdb --- a/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.gdb +++ b/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.gdb @@ -24,121 +24,124 @@ # CHECK-LABEL: +print IndexType print IndexType -# CHECK: mlir::IndexType +# CHECK: typeID = mlir::TypeID::get() # CHECK-LABEL: +print IntegerType print IntegerType -# CHECK: mlir::IntegerType -# CHECK: width = 3 -# CHECK: Unsigned +# CHECK: typeID = mlir::TypeID::get() +# CHECK: members of mlir::detail::IntegerTypeStorage # CHECK-LABEL: +print FloatType print FloatType -# CHECK: mlir::Float32Type +# CHECK: typeID = mlir::TypeID::get() # CHECK-LABEL: +print MemRefType print MemRefType -# CHECK: mlir::MemRefType -# CHECK: shape = llvm::ArrayRef of length 2 = {4, 5} -# CHECK: elementType -# CHECK: mlir::Float32Type +# CHECK: typeID = mlir::TypeID::get() +# CHECK: members of mlir::detail::MemRefTypeStorage # CHECK-LABEL: +print UnrankedMemRefType print UnrankedMemRefType -# CHECK: mlir::UnrankedMemRefType -# CHECK: elementType -# CHECK: mlir::IntegerType -# CHECK: memorySpace -# CHECK: 6 +# CHECK: typeID = mlir::TypeID::get() +# CHECK: members of mlir::detail::UnrankedMemRefTypeStorage # CHECK-LABEL: +print VectorType print VectorType -# CHECK: mlir::VectorType -# CHECK: shape = llvm::ArrayRef of length 2 = {1, 2} +# CHECK: typeID = mlir::TypeID::get() +# CHECK: members of mlir::detail::VectorTypeStorage # CHECK-LABEL: +print TupleType print TupleType -# CHECK: mlir::TupleType -# CHECK: numElements = 2 +# CHECK: typeID = mlir::TypeID::get() # CHECK: elements[0] -# CHECK: mlir::IndexType +# CHECK-NEXT: typeID = mlir::TypeID::get() # CHECK: elements[1] -# CHECK: mlir::Float32Type +# CHECK-NEXT: typeID = mlir::TypeID::get() # CHECK-LABEL: +print Result print Result -# CHECK: mlir::Float32Type +# CHECK: typeID = mlir::TypeID::get() # CHECK: outOfLineIndex = 42 # CHECK-LABEL: +print Value print Value -# CHECK: OutOfLineOpResult +# CHECK: typeID = mlir::TypeID::get() +# CHECK: mlir::detail::ValueImpl::Kind::OutOfLineOpResult # CHECK-LABEL: +print UnknownLoc print UnknownLoc -# CHECK: mlir::UnknownLoc +# CHECK: typeID = mlir::TypeID::get() # CHECK-LABEL: +print FileLineColLoc print FileLineColLoc -# CHECK: mlir::FileLineColLoc +# CHECK: typeID = mlir::TypeID::get() +# CHECK: members of mlir::detail::FileLineColLocAttrStorage # CHECK: "file" # CHECK: line = 7 # CHECK: column = 8 # CHECK-LABEL: +print OpaqueLoc print OpaqueLoc -# CHECK: mlir::OpaqueLoc +# CHECK: typeID = mlir::TypeID::get() +# CHECK: members of mlir::detail::OpaqueLocAttrStorage # CHECK: underlyingLocation = 9 # CHECK-LABEL: +print NameLoc print NameLoc -# CHECK: mlir::NameLoc +# CHECK: typeID = mlir::TypeID::get() +# CHECK: members of mlir::detail::NameLocAttrStorage # CHECK: "foo" -# CHECK: mlir::UnknownLoc +# CHECK: typeID = mlir::TypeID::get() # CHECK-LABEL: +print CallSiteLoc print CallSiteLoc -# CHECK: mlir::CallSiteLoc -# CHECK: callee -# CHECK: mlir::FileLineColLoc -# CHECK: caller -# CHECK: mlir::OpaqueLoc +# CHECK: typeID = mlir::TypeID::get() +# CHECK: members of mlir::detail::CallSiteLocAttrStorage +# CHECK: typeID = mlir::TypeID::get() +# CHECK: typeID = mlir::TypeID::get() # CHECK-LABEL: +print FusedLoc print FusedLoc -# CHECK: mlir::FusedLoc +# CHECK: typeID = mlir::TypeID::get() +# CHECK: members of mlir::detail::FusedLocAttrStorage # CHECK: locations = llvm::ArrayRef of length 2 -# CHECK: mlir::FileLineColLoc -# CHECK: mlir::NameLoc +# CHECK: typeID = mlir::TypeID::get() +# CHECK: typeID = mlir::TypeID::get() # CHECK-LABEL: +print UnitAttr print UnitAttr -# CHECK: mlir::UnitAttr +# CHECK: typeID = mlir::TypeID::get() # CHECK-LABEL: +print FloatAttr print FloatAttr -# CHECK: mlir::FloatAttr +# CHECK: typeID = mlir::TypeID::get() +# CHECK: members of mlir::detail::FloatAttrStorage # CHECK-LABEL: +print IntegerAttr print IntegerAttr -# CHECK: mlir::IntegerAttr +# CHECK: typeID = mlir::TypeID::get() +# CHECK: members of mlir::detail::IntegerAttrStorage # CHECK-LABEL: +print TypeAttr print TypeAttr -# CHECK: mlir::TypeAttr -# CHECK: mlir::IndexType +# CHECK: typeID = mlir::TypeID::get() +# CHECK: members of mlir::detail::TypeAttrStorage +# CHECK: typeID = mlir::TypeID::get() # CHECK-LABEL: +print ArrayAttr print ArrayAttr -# CHECK: mlir::ArrayAttr +# CHECK: typeID = mlir::TypeID::get() +# CHECK: members of mlir::detail::ArrayAttrStorage # CHECK: llvm::ArrayRef of length 1 -# CHECK: mlir::UnitAttr +# CHECK: typeID = mlir::TypeID::get() # CHECK-LABEL: +print StringAttr print StringAttr -# CHECK: mlir::StringAttr +# CHECK: typeID = mlir::TypeID::get() +# CHECK: members of mlir::detail::StringAttrStorage # CHECK: value = "foo" # CHECK-LABEL: +print ElementsAttr print ElementsAttr -# CHECK: mlir::DenseIntOrFPElementsAttr +# CHECK: typeID = mlir::TypeID::get() +# CHECK: members of mlir::detail::DenseIntOrFPElementsAttrStorage