xref: /llvm-project/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.gdb (revision fb4869e26c80dfc15d44d2c992f1958a1214d183)
1# RUN: gdb -q -batch -n \
2# RUN:   -iex 'source %mlir_src_root/utils/gdb-scripts/prettyprinters.py' \
3# RUN:   -iex 'source %llvm_src_root/utils/gdb-scripts/prettyprinters.py' \
4# RUN:   -ex 'source -v %s' %llvm_tools_dir/check-gdb-mlir-support \
5# RUN: | FileCheck %s
6# REQUIRES: debug-info
7# REQUIRES: mlir
8
9break main
10run
11set print pretty on
12
13# CHECK-LABEL: +print Identifier
14print Identifier
15# CHECK: "foo"
16
17# CHECK-LABEL: +print OperationName
18print OperationName
19# CHECK: "FooOp"
20
21# CHECK-LABEL: +print Type
22print Type
23# CHECK: impl = 0x0
24
25# CHECK-LABEL: +print IndexType
26print IndexType
27# CHECK: typeID = mlir::TypeID::get<mlir::IndexType>()
28
29# CHECK-LABEL: +print IntegerType
30print IntegerType
31# CHECK: typeID = mlir::TypeID::get<mlir::IntegerType>()
32# CHECK: members of mlir::detail::IntegerTypeStorage
33
34# CHECK-LABEL: +print FloatType
35print FloatType
36# CHECK: typeID = mlir::TypeID::get<mlir::Float32Type>()
37
38# CHECK-LABEL: +print MemRefType
39print MemRefType
40# CHECK: typeID = mlir::TypeID::get<mlir::MemRefType>()
41# CHECK: members of mlir::detail::MemRefTypeStorage
42
43# CHECK-LABEL: +print UnrankedMemRefType
44print UnrankedMemRefType
45# CHECK: typeID = mlir::TypeID::get<mlir::UnrankedMemRefType>()
46# CHECK: members of mlir::detail::UnrankedMemRefTypeStorage
47
48# CHECK-LABEL: +print VectorType
49print VectorType
50# CHECK: typeID = mlir::TypeID::get<mlir::VectorType>()
51# CHECK: members of mlir::detail::VectorTypeStorage
52
53# CHECK-LABEL: +print TupleType
54print TupleType
55# CHECK: typeID = mlir::TypeID::get<mlir::TupleType>()
56# CHECK: elements[0]
57# CHECK-NEXT: typeID = mlir::TypeID::get<mlir::IndexType>()
58# CHECK: elements[1]
59# CHECK-NEXT: typeID = mlir::TypeID::get<mlir::Float32Type>()
60
61# CHECK-LABEL: +print Result
62print Result
63# CHECK: typeID = mlir::TypeID::get<mlir::Float32Type>()
64# CHECK: outOfLineIndex = 42
65
66# CHECK-LABEL: +print Value
67print Value
68# CHECK: typeID = mlir::TypeID::get<mlir::Float32Type>()
69# CHECK: mlir::detail::ValueImpl::Kind::OutOfLineOpResult
70
71# CHECK-LABEL: +print UnknownLoc
72print UnknownLoc
73# CHECK: typeID = mlir::TypeID::get<mlir::UnknownLoc>()
74
75# CHECK-LABEL: +print FileLineColLoc
76print FileLineColLoc
77# CHECK: typeID = mlir::TypeID::get<mlir::FileLineColLoc>()
78# CHECK: members of mlir::detail::FileLineColLocAttrStorage
79# CHECK: "file"
80# CHECK: line = 7
81# CHECK: column = 8
82
83# CHECK-LABEL: +print OpaqueLoc
84print OpaqueLoc
85# CHECK: typeID = mlir::TypeID::get<mlir::OpaqueLoc>()
86# CHECK: members of mlir::detail::OpaqueLocAttrStorage
87# CHECK: underlyingLocation = 9
88
89# CHECK-LABEL: +print NameLoc
90print NameLoc
91# CHECK: typeID = mlir::TypeID::get<mlir::NameLoc>()
92# CHECK: members of mlir::detail::NameLocAttrStorage
93# CHECK: "foo"
94# CHECK: typeID = mlir::TypeID::get<mlir::UnknownLoc>()
95
96# CHECK-LABEL: +print CallSiteLoc
97print CallSiteLoc
98# CHECK: typeID = mlir::TypeID::get<mlir::CallSiteLoc>()
99# CHECK: members of mlir::detail::CallSiteLocAttrStorage
100# CHECK: typeID = mlir::TypeID::get<mlir::FileLineColLoc>()
101# CHECK: typeID = mlir::TypeID::get<mlir::OpaqueLoc>()
102
103# CHECK-LABEL: +print FusedLoc
104print FusedLoc
105# CHECK: typeID = mlir::TypeID::get<mlir::FusedLoc>()
106# CHECK: members of mlir::detail::FusedLocAttrStorage
107# CHECK: locations = llvm::ArrayRef of length 2
108# CHECK: typeID = mlir::TypeID::get<mlir::FileLineColLoc>()
109# CHECK: typeID = mlir::TypeID::get<mlir::NameLoc>()
110
111# CHECK-LABEL: +print UnitAttr
112print UnitAttr
113# CHECK: typeID = mlir::TypeID::get<mlir::UnitAttr>()
114
115# CHECK-LABEL: +print FloatAttr
116print FloatAttr
117# CHECK: typeID = mlir::TypeID::get<mlir::FloatAttr>()
118# CHECK: members of mlir::detail::FloatAttrStorage
119
120# CHECK-LABEL: +print IntegerAttr
121print IntegerAttr
122# CHECK: typeID = mlir::TypeID::get<mlir::IntegerAttr>()
123# CHECK: members of mlir::detail::IntegerAttrStorage
124
125# CHECK-LABEL: +print TypeAttr
126print TypeAttr
127# CHECK: typeID = mlir::TypeID::get<mlir::TypeAttr>()
128# CHECK: members of mlir::detail::TypeAttrStorage
129# CHECK: typeID = mlir::TypeID::get<mlir::IndexType>()
130
131# CHECK-LABEL: +print ArrayAttr
132print ArrayAttr
133# CHECK: typeID = mlir::TypeID::get<mlir::ArrayAttr>()
134# CHECK: members of mlir::detail::ArrayAttrStorage
135# CHECK: llvm::ArrayRef of length 1
136# CHECK: typeID = mlir::TypeID::get<mlir::UnitAttr>()
137
138# CHECK-LABEL: +print StringAttr
139print StringAttr
140# CHECK: typeID = mlir::TypeID::get<mlir::StringAttr>()
141# CHECK: members of mlir::detail::StringAttrStorage
142# CHECK: value = "foo"
143
144# CHECK-LABEL: +print ElementsAttr
145print ElementsAttr
146# CHECK: typeID = mlir::TypeID::get<mlir::DenseIntOrFPElementsAttr>()
147# CHECK: members of mlir::detail::DenseIntOrFPElementsAttrStorage
148