#include "llvm/ADT/StringRef.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/AsmParser/SlotMapping.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/SourceMgr.h"
#include "gtest/gtest.h"
usingnamespacellvm;
namespace {
TEST(AsmParserTest, NullTerminatedInput) { … }
#ifdef GTEST_HAS_DEATH_TEST
#ifndef NDEBUG
TEST(AsmParserTest, NonNullTerminatedInput) {
LLVMContext Ctx;
StringRef Source = "; Empty module \n\1\2";
SMDiagnostic Error;
std::unique_ptr<Module> Mod;
EXPECT_DEATH(Mod = parseAssemblyString(Source.substr(0, Source.size() - 2),
Error, Ctx),
"Buffer is not null terminated!");
}
#endif
#endif
TEST(AsmParserTest, SlotMappingTest) { … }
TEST(AsmParserTest, TypeAndConstantValueParsing) { … }
TEST(AsmParserTest, TypeAndConstantValueWithSlotMappingParsing) { … }
TEST(AsmParserTest, TypeWithSlotMappingParsing) { … }
TEST(AsmParserTest, TypeAtBeginningWithSlotMappingParsing) { … }
TEST(AsmParserTest, InvalidDataLayoutStringCallback) { … }
TEST(AsmParserTest, DIExpressionBodyAtBeginningWithSlotMappingParsing) { … }
}