| 10 | class TestRDAnalyzer : public TestBase { |
| 11 | protected: |
| 12 | std::set<RDNode> find(std::string FuncName, unsigned BIdx, unsigned IIdx, |
| 13 | unsigned OIdx, std::vector<std::string> FuncsToExplore, |
| 14 | RDExtension *Extension) { |
| 15 | if (!IRAH) |
| 16 | return {}; |
| 17 | |
| 18 | auto *I = IRAH->getInstruction(FuncName, BIdx, IIdx); |
| 19 | if (!I) |
| 20 | return {}; |
| 21 | |
| 22 | if (I->getNumOperands() <= OIdx) |
| 23 | return {}; |
| 24 | |
| 25 | const auto &U = I->getOperandUse(OIdx); |
| 26 | |
| 27 | std::vector<llvm::Function *> Funcs; |
| 28 | for (const auto &Func : FuncsToExplore) { |
| 29 | auto *F = IRAH->getFunction(Func); |
| 30 | if (!F) |
| 31 | return {}; |
| 32 | |
| 33 | Funcs.push_back(F); |
| 34 | } |
| 35 | |
| 36 | RDAnalyzer Analyzer(0, Extension); |
| 37 | Analyzer.setSearchSpace(Funcs); |
| 38 | return Analyzer.getRootDefinitions(U); |
| 39 | } |
| 40 | }; |
| 41 | |
| 42 | TEST_F(TestRDAnalyzer, NoResultHandleRegisterN) { |
no test coverage detected