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 2# REQUIRES: debug-info 3 4break main 5run 6 7# CHECK: llvm::ArrayRef of length 3 = {1, 2, 3} 8p ArrayRef 9 10# CHECK: llvm::ArrayRef of length 3 = {1, 2, 3} 11p MutableArrayRef 12 13# CHECK: llvm::DenseMap with 2 elements = { 14# CHECK: [4] = 5, 15# CHECK: [6] = 7, 16# CHECK: } 17p DenseMap 18 19# CHECK: llvm::Expected = {value = 8} 20p ExpectedValue 21 22# CHECK: llvm::Expected is error 23p ExpectedError 24 25# CHECK: llvm::Optional = {value = 9} 26p OptionalValue 27 28# CHECK: llvm::Optional is not initialized 29p OptionalNone 30 31# CHECK: llvm::SmallVector of Size 3, Capacity 5 = {10, 11, 12} 32p SmallVector 33 34# CHECK: "foo" 35p SmallString 36 37# CHECK: "bar" 38p StringRef 39 40# CHECK: "\"foo\"\"bar\"" 41p Twine 42 43# CHECK: llvm::StringMap with 2 elements = {["foo"] = 123, ["bar"] = 456} 44p StringMap 45 46# CHECK: {pointer = 0xabc, value = 1} 47p PointerIntPair 48 49# CHECK: Containing int * = {pointer = 0xabc} 50p PointerUnion 51 52# CHECK: PointerUnionMembers<llvm::PointerUnion<Z*, float*>, 53p RawPrintingPointerUnion 54 55# Switch to print pretty adds newlines to the following statements. 56set print pretty 57 58# CHECK: { 59# CHECK: [0] = { 60# CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<A> >> = { 61# CHECK: prev = [[Ilist_Sentinel:0x.*]] <Ilist>, 62# CHECK: next = [[Node_14:0x.*]] 63# CHECK: }, 64# CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = { 65# CHECK: prev = [[Node_14]], 66# CHECK: next = [[SimpleIlist_Sentinel:0x.*]] <SimpleIlist> 67# CHECK: }, 68# CHECK: members of IlistNode: 69# CHECK: Value = 13 70# CHECK: }, 71# CHECK: [1] = { 72# CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<A> >> = { 73# CHECK: prev = [[Node_13:0x.*]], 74# CHECK: next = [[Node_15:0x.*]] 75# CHECK: }, 76# CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = { 77# CHECK: prev = [[Node_15]], 78# CHECK: next = [[Node_13]] 79# CHECK: }, 80# CHECK: members of IlistNode: 81# CHECK: Value = 14 82# CHECK: }, 83# CHECK: [2] = { 84# CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<A> >> = { 85# CHECK: prev = [[Node_14]], 86# CHECK: next = [[Ilist_Sentinel]] <Ilist> 87# CHECK: }, 88# CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = { 89# CHECK: prev = [[SimpleIlist_Sentinel]] <SimpleIlist>, 90# CHECK: next = [[Node_14]] 91# CHECK: }, 92# CHECK: members of IlistNode: 93# CHECK: Value = 15 94# CHECK: } 95# CHECK: } 96p Ilist 97 98# CHECK: { 99# CHECK: [0] = { 100# CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<A> >> = { 101# CHECK: prev = [[Node_14]], 102# CHECK: next = [[Ilist_Sentinel]] <Ilist> 103# CHECK: }, 104# CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = { 105# CHECK: prev = [[SimpleIlist_Sentinel]] <SimpleIlist>, 106# CHECK: next = [[Node_14]] 107# CHECK: }, 108# CHECK: members of IlistNode: 109# CHECK: Value = 15 110# CHECK: }, 111# CHECK: [1] = { 112# CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<A> >> = { 113# CHECK: prev = [[Node_13]], 114# CHECK: next = [[Node_15]] 115# CHECK: }, 116# CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = { 117# CHECK: prev = [[Node_15]], 118# CHECK: next = [[Node_13]] 119# CHECK: }, 120# CHECK: members of IlistNode: 121# CHECK: Value = 14 122# CHECK: }, 123# CHECK: [2] = { 124# CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<A> >> = { 125# CHECK: prev = [[Ilist_Sentinel]] <Ilist>, 126# CHECK: next = [[Node_14]] 127# CHECK: }, 128# CHECK: <llvm::ilist_node<IlistNode, llvm::ilist_tag<B> >> = { 129# CHECK: prev = [[Node_14]], 130# CHECK: next = [[SimpleIlist_Sentinel]] <SimpleIlist> 131# CHECK: }, 132# CHECK: members of IlistNode: 133# CHECK: Value = 13 134# CHECK: } 135# CHECK: } 136p SimpleIlist 137