diff options
| -rw-r--r-- | llvm/unittests/MI/LiveIntervalTest.cpp | 3 | ||||
| -rw-r--r-- | llvm/unittests/Target/AArch64/InstSizes.cpp | 15 |
2 files changed, 6 insertions, 12 deletions
diff --git a/llvm/unittests/MI/LiveIntervalTest.cpp b/llvm/unittests/MI/LiveIntervalTest.cpp index 7118a43e6d8..43dfa4a7978 100644 --- a/llvm/unittests/MI/LiveIntervalTest.cpp +++ b/llvm/unittests/MI/LiveIntervalTest.cpp @@ -151,8 +151,7 @@ body: | std::unique_ptr<MIRParser> MIR; std::unique_ptr<Module> M = parseMIR(Context, PM, MIR, *TM, MIRString, "func"); - if (!M) - report_fatal_error("Could not parse MIR code\n"); + EXPECT_TRUE(M); PM.add(new TestPass(T)); diff --git a/llvm/unittests/Target/AArch64/InstSizes.cpp b/llvm/unittests/Target/AArch64/InstSizes.cpp index c1fe7f22dc5..32b91da0910 100644 --- a/llvm/unittests/Target/AArch64/InstSizes.cpp +++ b/llvm/unittests/Target/AArch64/InstSizes.cpp @@ -21,8 +21,7 @@ std::unique_ptr<TargetMachine> createTargetMachine() { std::string Error; const Target *TheTarget = TargetRegistry::lookupTarget(TT, Error); - if (!TheTarget) - report_fatal_error("Target not registered"); + EXPECT_TRUE(TheTarget); return std::unique_ptr<TargetMachine>( TheTarget->createTargetMachine(TT, CPU, FS, TargetOptions(), None, @@ -59,24 +58,20 @@ void runChecks( std::unique_ptr<MemoryBuffer> MBuffer = MemoryBuffer::getMemBuffer(MIRString); std::unique_ptr<MIRParser> MParser = createMIRParser(std::move(MBuffer), Context); - if (!MParser) - report_fatal_error("Couldn't create MIR parser"); + EXPECT_TRUE(MParser); std::unique_ptr<Module> M = MParser->parseIRModule(); - if (!M) - report_fatal_error("Couldn't parse module"); + EXPECT_TRUE(M); M->setTargetTriple(TM->getTargetTriple().getTriple()); M->setDataLayout(TM->createDataLayout()); MachineModuleInfo MMI(TM); bool Res = MParser->parseMachineFunctions(*M, MMI); - if (Res) - report_fatal_error("Couldn't parse MIR functions"); + EXPECT_FALSE(Res); auto F = M->getFunction("sizes"); - if (!F) - report_fatal_error("Couldn't find intended function"); + EXPECT_TRUE(F); auto &MF = MMI.getOrCreateMachineFunction(*F); Checks(*II, MF); |

