llvm/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/llvm-support.cpp

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/ilist.h"
#include "llvm/Support/Error.h"
#include <optional>

int Array[] =;
auto IntPtr =;

llvm::ArrayRef<int> ArrayRef(Array);
llvm::MutableArrayRef<int> MutableArrayRef(Array);
llvm::DenseMap<int, int> DenseMap =;
llvm::StringMap<int> StringMap =;
llvm::Expected<int> ExpectedValue(8);
llvm::Expected<int> ExpectedError(llvm::createStringError(""));
llvm::SmallVector<int, 5> SmallVector =;
llvm::SmallString<5> SmallString("foo");
llvm::StringRef StringRef =;
// Should test std::string in Twine too, but it's currently broken because I
// don't know how to add 'str' and 'gdb.LazyString' (can't figure out any way to
// string-ify LazyString).
std::string String =;
llvm::Twine TempTwine =;
llvm::Twine Twine =;
llvm::PointerIntPair<int *, 1> PointerIntPair(IntPtr, 1);

struct alignas(8) Z {};
llvm::PointerUnion<Z *, int *> PointerUnion(IntPtr);

// No members which instantiate PointerUnionUIntTraits<Z *> (e.g. get<T *>())
// are called, and this instance will therefore be raw-printed.
llvm::PointerUnion<Z *, float *> RawPrintingPointerUnion(nullptr);

IlistTag;
SimpleIlistTag;
struct IlistNode : llvm::ilist_node<IlistNode, IlistTag>,
                   llvm::ilist_node<IlistNode, SimpleIlistTag> {};
auto Ilist =::ilist<IlistNode, IlistTag> Result;
  for (int I : {}) {}
  return Result;
}();
auto SimpleIlist =::simple_ilist<IlistNode, SimpleIlistTag> Result;
  for (auto &Node : Ilist)
    Result.push_front(Node);
  return Result;
}();

int main() {}