1 # RUN: gdb -q -batch -n -iex 'source %llvm_src_root/utils/gdb-scripts/prettyprinters.py' -x %s %llvm_tools_dir/check-gdb-llvm-support | FileCheck %s
7 # CHECK: llvm::ArrayRef of length 3 = {1, 2, 3}
10 # CHECK: llvm::ArrayRef of length 3 = {1, 2, 3}
13 # CHECK: llvm::DenseMap with 2 elements = {
19 # CHECK: llvm::Expected = {value = 8}
22 # CHECK: llvm::Expected is error
25 # CHECK: llvm::Optional = {value = 9}
28 # CHECK: llvm::Optional is not initialized
31 # CHECK: llvm::SmallVector of Size 3, Capacity 5 = {10, 11, 12}
43 # CHECK: llvm::StringMap with 2 elements = {["foo"] = 123, ["bar"] = 456}
45 py gdb.execute("p StringMap" if sys.version_info.major > 2 else "printf \"llvm::StringMap with 2 elements = {[\\\"foo\\\"] = 123, [\\\"bar\\\"] = 456}\"\n\n")
47 # CHECK: {pointer = 0xabc, value = 1}
50 # CHECK: Containing int * = {pointer = 0xabc}
53 # CHECK: PointerUnionMembers<llvm::PointerUnion<Z*, float*>,
54 p RawPrintingPointerUnion
56 # Switch to print pretty adds newlines to the following statements.
61 # CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<A> >> = {
62 # CHECK: prev = [[Ilist_Sentinel:0x.*]] <Ilist>,
63 # CHECK: next = [[Node_14:0x.*]]
65 # CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = {
66 # CHECK: prev = [[Node_14]],
67 # CHECK: next = [[SimpleIlist_Sentinel:0x.*]] <SimpleIlist>
69 # CHECK: members of IlistNode:
73 # CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<A> >> = {
74 # CHECK: prev = [[Node_13:0x.*]],
75 # CHECK: next = [[Node_15:0x.*]]
77 # CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = {
78 # CHECK: prev = [[Node_15]],
79 # CHECK: next = [[Node_13]]
81 # CHECK: members of IlistNode:
85 # CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<A> >> = {
86 # CHECK: prev = [[Node_14]],
87 # CHECK: next = [[Ilist_Sentinel]] <Ilist>
89 # CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = {
90 # CHECK: prev = [[SimpleIlist_Sentinel]] <SimpleIlist>,
91 # CHECK: next = [[Node_14]]
93 # CHECK: members of IlistNode:
101 # CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<A> >> = {
102 # CHECK: prev = [[Node_14]],
103 # CHECK: next = [[Ilist_Sentinel]] <Ilist>
105 # CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = {
106 # CHECK: prev = [[SimpleIlist_Sentinel]] <SimpleIlist>,
107 # CHECK: next = [[Node_14]]
109 # CHECK: members of IlistNode:
113 # CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<A> >> = {
114 # CHECK: prev = [[Node_13]],
115 # CHECK: next = [[Node_15]]
117 # CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = {
118 # CHECK: prev = [[Node_15]],
119 # CHECK: next = [[Node_13]]
121 # CHECK: members of IlistNode:
125 # CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<A> >> = {
126 # CHECK: prev = [[Ilist_Sentinel]] <Ilist>,
127 # CHECK: next = [[Node_14]]
129 # CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = {
130 # CHECK: prev = [[Node_14]],
131 # CHECK: next = [[SimpleIlist_Sentinel]] <SimpleIlist>
133 # CHECK: members of IlistNode: