[llvm] r305522 - UnitTests: Followup to 305519
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 15 15:50:57 PDT 2017
Author: matze
Date: Thu Jun 15 17:50:57 2017
New Revision: 305522
URL: http://llvm.org/viewvc/llvm-project?rev=305522&view=rev
Log:
UnitTests: Followup to 305519
We have to use ASSERT_XXX instead of EXPECT_XXX if the test cannot
continue in the failure case.
Modified:
llvm/trunk/unittests/MI/LiveIntervalTest.cpp
llvm/trunk/unittests/Target/AArch64/InstSizes.cpp
Modified: llvm/trunk/unittests/MI/LiveIntervalTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/MI/LiveIntervalTest.cpp?rev=305522&r1=305521&r2=305522&view=diff
==============================================================================
--- llvm/trunk/unittests/MI/LiveIntervalTest.cpp (original)
+++ llvm/trunk/unittests/MI/LiveIntervalTest.cpp Thu Jun 15 17:50:57 2017
@@ -151,7 +151,7 @@ body: |
std::unique_ptr<MIRParser> MIR;
std::unique_ptr<Module> M = parseMIR(Context, PM, MIR, *TM, MIRString,
"func");
- EXPECT_TRUE(M);
+ ASSERT_TRUE(M);
PM.add(new TestPass(T));
Modified: llvm/trunk/unittests/Target/AArch64/InstSizes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Target/AArch64/InstSizes.cpp?rev=305522&r1=305521&r2=305522&view=diff
==============================================================================
--- llvm/trunk/unittests/Target/AArch64/InstSizes.cpp (original)
+++ llvm/trunk/unittests/Target/AArch64/InstSizes.cpp Thu Jun 15 17:50:57 2017
@@ -21,7 +21,6 @@ std::unique_ptr<TargetMachine> createTar
std::string Error;
const Target *TheTarget = TargetRegistry::lookupTarget(TT, Error);
- EXPECT_TRUE(TheTarget);
return std::unique_ptr<TargetMachine>(
TheTarget->createTargetMachine(TT, CPU, FS, TargetOptions(), None,
@@ -58,20 +57,20 @@ void runChecks(
std::unique_ptr<MemoryBuffer> MBuffer = MemoryBuffer::getMemBuffer(MIRString);
std::unique_ptr<MIRParser> MParser =
createMIRParser(std::move(MBuffer), Context);
- EXPECT_TRUE(MParser);
+ ASSERT_TRUE(MParser);
std::unique_ptr<Module> M = MParser->parseIRModule();
- EXPECT_TRUE(M);
+ ASSERT_TRUE(M);
M->setTargetTriple(TM->getTargetTriple().getTriple());
M->setDataLayout(TM->createDataLayout());
MachineModuleInfo MMI(TM);
bool Res = MParser->parseMachineFunctions(*M, MMI);
- EXPECT_FALSE(Res);
+ ASSERT_FALSE(Res);
auto F = M->getFunction("sizes");
- EXPECT_TRUE(F);
+ ASSERT_TRUE(F != nullptr);
auto &MF = MMI.getOrCreateMachineFunction(*F);
Checks(*II, MF);
@@ -81,6 +80,7 @@ void runChecks(
TEST(InstSizes, STACKMAP) {
std::unique_ptr<TargetMachine> TM = createTargetMachine();
+ ASSERT_TRUE(TM);
std::unique_ptr<AArch64InstrInfo> II = createInstrInfo(TM.get());
runChecks(TM.get(), II.get(), "", " STACKMAP 0, 16\n"
More information about the llvm-commits
mailing list