mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01: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:
parent
7ae6cd32d6
commit
c273bf9f3a
@ -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));
|
||||
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user