summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2018-01-04 05:04:41 +0000
committerBob Wilson <bob.wilson@apple.com>2018-01-04 05:04:41 +0000
commit238deafb92cf7ed83d646a25bfee3932146c73d5 (patch)
tree403e344911bc12ad6fa2e3ec4151aeff423bcdf1
parent90ecac01e9dcbcaf92781a6dcffa07a27191b661 (diff)
downloadbcm5719-llvm-238deafb92cf7ed83d646a25bfee3932146c73d5.tar.gz
bcm5719-llvm-238deafb92cf7ed83d646a25bfee3932146c73d5.zip
Remove the unit test from r321783.
This test fails when run on the sanitizer bot, and I do not see a good way to fix it. The existing bogus target in MachineInstrTest.cpp is only good enough to create instructions but not sufficient to insert them into basic blocks. The addNodeToList ilist callback dereferences the pointer to the MachineRegisterInfo. Adding MachineRegisterInfo would also require TargetRegisterInfo, even a minimal implementation of that would be quite complicated. I would be glad to add this back if someone can suggest a better way to do it. llvm-svn: 321784
-rw-r--r--llvm/unittests/CodeGen/MachineInstrTest.cpp68
1 files changed, 0 insertions, 68 deletions
diff --git a/llvm/unittests/CodeGen/MachineInstrTest.cpp b/llvm/unittests/CodeGen/MachineInstrTest.cpp
index eccf2bcfbe2..aca640ebcf3 100644
--- a/llvm/unittests/CodeGen/MachineInstrTest.cpp
+++ b/llvm/unittests/CodeGen/MachineInstrTest.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
#include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/TargetFrameLowering.h"
@@ -245,71 +244,4 @@ TEST(MachineInstrExpressionTraitTest, IsEqualAgreesWithGetHashValue) {
checkHashAndIsEqualMatch(VD2PU, VD2PD);
}
-
-TEST(MachineBasicBlockTest, PhiRange) {
- auto MF = createMachineFunction();
-
- // Create the main block.
- auto BB = MF->CreateMachineBasicBlock();
-
- // Create some predecessors of it.
- auto BB1 = MF->CreateMachineBasicBlock();
- BB1->addSuccessor(BB);
- auto BB2 = MF->CreateMachineBasicBlock();
- BB2->addSuccessor(BB);
-
- // Make sure this doesn't crash if there are no phis.
- for (auto &PN : BB->phis()) {
- (void)PN;
- ASSERT_TRUE(false) << "empty block should have no phis";
- }
-
- // Make it a cycle.
- BB->addSuccessor(BB);
-
- // Now insert some PHI nodes.
- MCOperandInfo OpInfo[] = { { -1, 0, MCOI::OPERAND_UNKNOWN, 0} };
- MCInstrDesc PHIMCID = {
- TargetOpcode::PHI, 1, 1, 0, 0,
- (1ULL << MCID::Pseudo) | (1ULL << MCID::Variadic), 0,
- nullptr, nullptr, OpInfo, -1, nullptr};
- auto P1 = BuildMI(*BB, BB->end(), DebugLoc(), PHIMCID, -101);
- auto P2 = BuildMI(*BB, BB->end(), DebugLoc(), PHIMCID, -102);
- auto P3 = BuildMI(*BB, BB->end(), DebugLoc(), PHIMCID, -103);
-
- // A non-PHI node.
- MCInstrDesc ImpDefMCID = {
- TargetOpcode::IMPLICIT_DEF, 1, 1, 0, 0,
- (1ULL << MCID::Pseudo), 0,
- nullptr, nullptr, OpInfo, -1, nullptr};
- BuildMI(*BB, BB->end(), DebugLoc(), ImpDefMCID, -104);
-
- // Now wire up the incoming values that are interesting.
- P1.addReg(-102).addMBB(BB);
- P2.addReg(-101).addMBB(BB);
- P3.addReg(-104).addMBB(BB);
-
- // Finally, let's iterate them, which is the thing we're trying to test.
- // We'll use this to wire up the rest of the incoming values.
- for (auto &PN : BB->phis()) {
- EXPECT_TRUE(PN.isPHI());
- PN.addOperand(*MF, MachineOperand::CreateReg(-100, /*isDef*/ false));
- PN.addOperand(*MF, MachineOperand::CreateMBB(BB1));
- PN.addOperand(*MF, MachineOperand::CreateReg(-100, /*isDef*/ false));
- PN.addOperand(*MF, MachineOperand::CreateMBB(BB2));
- }
-
- // Test that we can use const iterators and generally that the iterators
- // behave like iterators.
- MachineBasicBlock::const_iterator CI;
- CI = BB->phis().begin();
- EXPECT_NE(CI, BB->phis().end());
-
- // And iterate a const range.
- for (const auto &PN : const_cast<const MachineBasicBlock *>(BB)->phis()) {
- EXPECT_EQ(BB, PN.getOperand(2).getMBB());
- EXPECT_EQ(BB1, PN.getOperand(4).getMBB());
- EXPECT_EQ(BB2, PN.getOperand(6).getMBB());
- }
-}
} // end namespace
OpenPOWER on IntegriCloud