summaryrefslogtreecommitdiffstats
path: root/llvm/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests')
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/ObjectLinkingLayerTest.cpp8
-rw-r--r--llvm/unittests/IR/VerifierTest.cpp9
-rw-r--r--llvm/unittests/ProfileData/InstrProfTest.cpp17
-rw-r--r--llvm/unittests/Support/AlignOfTest.cpp8
4 files changed, 20 insertions, 22 deletions
diff --git a/llvm/unittests/ExecutionEngine/Orc/ObjectLinkingLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/ObjectLinkingLayerTest.cpp
index f4267c95be0..a733bd558c8 100644
--- a/llvm/unittests/ExecutionEngine/Orc/ObjectLinkingLayerTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/ObjectLinkingLayerTest.cpp
@@ -37,14 +37,13 @@ public:
return SectionMemoryManager::needsToReserveAllocationSpace();
}
- bool finalizeMemory(std::string *ErrMsg = 0) override {
+ bool finalizeMemory(std::string *ErrMsg = nullptr) override {
++FinalizationCount;
return SectionMemoryManager::finalizeMemory(ErrMsg);
}
};
TEST(ObjectLinkingLayerTest, TestSetProcessAllSections) {
-
class SectionMemoryManagerWrapper : public SectionMemoryManager {
public:
SectionMemoryManagerWrapper(bool &DebugSeen) : DebugSeen(DebugSeen) {}
@@ -113,9 +112,7 @@ TEST(ObjectLinkingLayerTest, TestSetProcessAllSections) {
}
}
-
TEST_F(ObjectLinkingLayerExecutionTest, NoDuplicateFinalization) {
-
if (!TM)
return;
@@ -187,7 +184,6 @@ TEST_F(ObjectLinkingLayerExecutionTest, NoDuplicateFinalization) {
}
TEST_F(ObjectLinkingLayerExecutionTest, NoPrematureAllocation) {
-
if (!TM)
return;
@@ -250,4 +246,4 @@ TEST_F(ObjectLinkingLayerExecutionTest, NoPrematureAllocation) {
"(multiple unrelated objects loaded prior to finalization)";
}
-}
+} // end anonymous namespace
diff --git a/llvm/unittests/IR/VerifierTest.cpp b/llvm/unittests/IR/VerifierTest.cpp
index c24e8d732b5..1acedf38fc8 100644
--- a/llvm/unittests/IR/VerifierTest.cpp
+++ b/llvm/unittests/IR/VerifierTest.cpp
@@ -1,4 +1,4 @@
-//===- llvm/unittest/IR/VerifierTest.cpp - Verifier unit tests ------------===//
+//===- llvm/unittest/IR/VerifierTest.cpp - Verifier unit tests --*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -126,7 +126,8 @@ TEST(VerifierTest, CrossModuleMetadataRef) {
Module M2("M2", C);
GlobalVariable *newGV =
new GlobalVariable(M1, Type::getInt8Ty(C), false,
- GlobalVariable::ExternalLinkage, NULL, "Some Global");
+ GlobalVariable::ExternalLinkage, nullptr,
+ "Some Global");
DIBuilder dbuilder(M2);
auto CU = dbuilder.createCompileUnit(dwarf::DW_LANG_Julia, "test.jl", ".",
@@ -143,5 +144,5 @@ TEST(VerifierTest, CrossModuleMetadataRef) {
EXPECT_TRUE(StringRef(ErrorOS.str())
.startswith("Referencing global in another module!"));
}
-}
-}
+} // end anonymous namespace
+} // end namespace llvm
diff --git a/llvm/unittests/ProfileData/InstrProfTest.cpp b/llvm/unittests/ProfileData/InstrProfTest.cpp
index 64eec387b3e..fe29f98e2bc 100644
--- a/llvm/unittests/ProfileData/InstrProfTest.cpp
+++ b/llvm/unittests/ProfileData/InstrProfTest.cpp
@@ -14,7 +14,6 @@
#include "llvm/ProfileData/InstrProfWriter.h"
#include "llvm/Support/Compression.h"
#include "gtest/gtest.h"
-
#include <cstdarg>
using namespace llvm;
@@ -490,22 +489,24 @@ ValueProfNode Site1Values[5] = {{{uint64_t("callee1"), 400}, &Site1Values[1]},
{{uint64_t("callee2"), 1000}, &Site1Values[2]},
{{uint64_t("callee3"), 500}, &Site1Values[3]},
{{uint64_t("callee4"), 300}, &Site1Values[4]},
- {{uint64_t("callee5"), 100}, 0}};
+ {{uint64_t("callee5"), 100}, nullptr}};
ValueProfNode Site2Values[4] = {{{uint64_t("callee5"), 800}, &Site2Values[1]},
{{uint64_t("callee3"), 1000}, &Site2Values[2]},
{{uint64_t("callee2"), 2500}, &Site2Values[3]},
- {{uint64_t("callee1"), 1300}, 0}};
+ {{uint64_t("callee1"), 1300}, nullptr}};
ValueProfNode Site3Values[3] = {{{uint64_t("callee6"), 800}, &Site3Values[1]},
{{uint64_t("callee3"), 1000}, &Site3Values[2]},
- {{uint64_t("callee4"), 5500}, 0}};
+ {{uint64_t("callee4"), 5500}, nullptr}};
ValueProfNode Site4Values[2] = {{{uint64_t("callee2"), 1800}, &Site4Values[1]},
- {{uint64_t("callee3"), 2000}, 0}};
+ {{uint64_t("callee3"), 2000}, nullptr}};
static ValueProfNode *ValueProfNodes[5] = {&Site1Values[0], &Site2Values[0],
- &Site3Values[0], &Site4Values[0], 0};
+ &Site3Values[0], &Site4Values[0],
+ nullptr};
+
static uint16_t NumValueSites[IPVK_Last + 1] = {5};
TEST_F(InstrProfTest, runtime_value_prof_data_read_write) {
ValueProfRuntimeRecord RTRecord;
@@ -516,7 +517,7 @@ TEST_F(InstrProfTest, runtime_value_prof_data_read_write) {
InstrProfRecord Record("caller", 0x1234, {1ULL << 31, 2});
- VPData->deserializeTo(Record, 0);
+ VPData->deserializeTo(Record, nullptr);
// Now read data from Record and sanity check the data
ASSERT_EQ(5U, Record.getNumValueSites(IPVK_IndirectCallTarget));
@@ -687,7 +688,7 @@ TEST_F(InstrProfTest, instr_prof_symtab_module_test) {
for (unsigned I = 0; I < sizeof(Funcs) / sizeof(*Funcs); I++) {
Function *F = M->getFunction(Funcs[I]);
- ASSERT_TRUE(F != NULL);
+ ASSERT_TRUE(F != nullptr);
std::string PGOName = getPGOFuncName(*F);
uint64_t Key = IndexedInstrProf::ComputeHash(PGOName);
ASSERT_EQ(StringRef(PGOName),
diff --git a/llvm/unittests/Support/AlignOfTest.cpp b/llvm/unittests/Support/AlignOfTest.cpp
index be208f7d28e..393bfebd664 100644
--- a/llvm/unittests/Support/AlignOfTest.cpp
+++ b/llvm/unittests/Support/AlignOfTest.cpp
@@ -1,4 +1,4 @@
-//=== - llvm/unittest/Support/AlignOfTest.cpp - Alignment utility tests ----===//
+//=== - llvm/unittest/Support/AlignOfTest.cpp - Alignment utility tests ---===//
//
// The LLVM Compiler Infrastructure
//
@@ -90,14 +90,14 @@ V7::~V7() {}
V8::~V8() {}
struct Abstract1 {
- virtual ~Abstract1() {}
+ virtual ~Abstract1() = default;
virtual void method() = 0;
char c;
};
struct Abstract2 : Abstract1 {
- virtual ~Abstract2() {}
+ ~Abstract2() override = default;
double d;
};
@@ -354,4 +354,4 @@ TEST(AlignOfTest, BasicAlignedArray) {
EXPECT_EQ(2u, sizeof(AlignedCharArray<2, 2>));
EXPECT_EQ(16u, sizeof(AlignedCharArray<2, 16>));
}
-}
+} // end anonymous namespace
OpenPOWER on IntegriCloud