1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

UnitTests: Followup to 305519

We have to use ASSERT_XXX instead of EXPECT_XXX if the test cannot
continue in the failure case.

llvm-svn: 305522
This commit is contained in:
Matthias Braun 2017-06-15 22:50:57 +00:00
parent 7ae6cd32d6
commit c273bf9f3a
2 changed files with 6 additions and 6 deletions

View File

@ -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));

View File

@ -21,7 +21,6 @@ std::unique_ptr<TargetMachine> createTargetMachine() {
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"