llvm/llvm/unittests/ProfileData/MemProfTest.cpp

//===- unittests/Support/MemProfTest.cpp ----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "llvm/ProfileData/MemProf.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLForwardCompat.h"
#include "llvm/DebugInfo/DIContext.h"
#include "llvm/DebugInfo/Symbolize/SymbolizableModule.h"
#include "llvm/IR/Value.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/ProfileData/MemProfData.inc"
#include "llvm/ProfileData/MemProfReader.h"
#include "llvm/Support/raw_ostream.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"

#include <initializer_list>

namespace {

DIGlobal;
DIInliningInfo;
DILineInfo;
DILineInfoSpecifier;
DILocal;
StringRef;
CallStackId;
CallStackMap;
Frame;
FrameId;
IndexedAllocationInfo;
IndexedMemProfRecord;
MemInfoBlock;
MemProfReader;
MemProfRecord;
MemProfSchema;
Meta;
PortableMemInfoBlock;
RawMemProfReader;
SegmentEntry;
SectionedAddress;
SymbolizableModule;
Return;
SizeIs;

class MockSymbolizer : public SymbolizableModule {};

struct MockInfo {};
DIInliningInfo makeInliningInfo(std::initializer_list<MockInfo> MockFrames) {}

llvm::SmallVector<SegmentEntry, 4> makeSegments() {}

const DILineInfoSpecifier specifier() {}

MATCHER_P4(FrameContains, FunctionName, LineOffset, Column, Inline, "") {}

TEST(MemProf, FillsValue) {}

TEST(MemProf, PortableWrapper) {}

// Version0 and Version1 serialize IndexedMemProfRecord in the same format, so
// we share one test.
TEST(MemProf, RecordSerializationRoundTripVersion0And1) {}

TEST(MemProf, RecordSerializationRoundTripVerion2) {}

TEST(MemProf, RecordSerializationRoundTripVersion2HotColdSchema) {}

TEST(MemProf, SymbolizationFilter) {}

TEST(MemProf, BaseMemProfReader) {}

TEST(MemProf, BaseMemProfReaderWithCSIdMap) {}

TEST(MemProf, IndexedMemProfRecordToMemProfRecord) {}

FrameIdMapTy;
CallStackIdMapTy;

// Populate those fields returned by getHotColdSchema.
MemInfoBlock makePartialMIB() {}

TEST(MemProf, MissingCallStackId) {}

TEST(MemProf, MissingFrameId) {}

// Verify CallStackRadixTreeBuilder can handle empty inputs.
TEST(MemProf, RadixTreeBuilderEmpty) {}

// Verify CallStackRadixTreeBuilder can handle one trivial call stack.
TEST(MemProf, RadixTreeBuilderOne) {}

// Verify CallStackRadixTreeBuilder can form a link between two call stacks.
TEST(MemProf, RadixTreeBuilderTwo) {}

// Verify CallStackRadixTreeBuilder can form a jump to a prefix that itself has
// another jump to another prefix.
TEST(MemProf, RadixTreeBuilderSuccessiveJumps) {}
} // namespace