Coverage Report

Created: 2021-01-26 06:56

/Users/buildslave/jenkins/workspace/coverage/llvm-project/debuginfo-tests/llvm-prettyprinters/gdb/llvm-support.cpp
Line
Count
Source (jump to first uncovered line)
1
#include "llvm/ADT/ArrayRef.h"
2
#include "llvm/ADT/DenseMap.h"
3
#include "llvm/ADT/Optional.h"
4
#include "llvm/ADT/PointerIntPair.h"
5
#include "llvm/ADT/PointerUnion.h"
6
#include "llvm/ADT/SmallString.h"
7
#include "llvm/ADT/SmallVector.h"
8
#include "llvm/ADT/StringMap.h"
9
#include "llvm/ADT/Twine.h"
10
#include "llvm/ADT/ilist.h"
11
#include "llvm/Support/Error.h"
12
13
int Array[] = {1, 2, 3};
14
auto IntPtr = reinterpret_cast<int *>(0xabc);
15
16
llvm::ArrayRef<int> ArrayRef(Array);
17
llvm::MutableArrayRef<int> MutableArrayRef(Array);
18
llvm::DenseMap<int, int> DenseMap = {{4, 5}, {6, 7}};
19
llvm::StringMap<int> StringMap = {{"foo", 123}, {"bar", 456}};
20
llvm::Expected<int> ExpectedValue(8);
21
llvm::Expected<int> ExpectedError(llvm::createStringError({}, ""));
22
llvm::Optional<int> OptionalValue(9);
23
llvm::Optional<int> OptionalNone(llvm::None);
24
llvm::SmallVector<int, 5> SmallVector = {10, 11, 12};
25
llvm::SmallString<5> SmallString("foo");
26
llvm::StringRef StringRef = "bar";
27
llvm::Twine Twine = llvm::Twine(SmallString) + StringRef;
28
llvm::PointerIntPair<int *, 1> PointerIntPair(IntPtr, 1);
29
30
struct alignas(8) Z {};
31
llvm::PointerUnion<Z *, int *> PointerUnion(IntPtr);
32
33
// No members which instantiate PointerUnionUIntTraits<Z *> (e.g. get<T *>())
34
// are called, and this instance will therefore be raw-printed.
35
llvm::PointerUnion<Z *, float *> RawPrintingPointerUnion(nullptr);
36
37
using IlistTag = llvm::ilist_tag<struct A>;
38
using SimpleIlistTag = llvm::ilist_tag<struct B>;
39
struct IlistNode : llvm::ilist_node<IlistNode, IlistTag>,
40
                   llvm::ilist_node<IlistNode, SimpleIlistTag> {
41
  int Value;
42
};
43
0
auto Ilist = [] {
44
0
  llvm::ilist<IlistNode, IlistTag> Result;
45
0
  for (int I : {13, 14, 15}) {
46
0
    Result.push_back(new IlistNode);
47
0
    Result.back().Value = I;
48
0
  }
49
0
  return Result;
50
0
}();
51
0
auto SimpleIlist = []() {
52
0
  llvm::simple_ilist<IlistNode, SimpleIlistTag> Result;
53
0
  for (auto &Node : Ilist)
54
0
    Result.push_front(Node);
55
0
  return Result;
56
0
}();
57
58
int main() {
59
  // Reference symbols that might otherwise be stripped.
60
  ArrayRef[0];
61
  MutableArrayRef[0];
62
  (void)!ExpectedValue;
63
  (void)!ExpectedError;
64
  *OptionalValue;
65
  *OptionalNone;
66
  return 0;
67
}