| 67 | }; |
| 68 | |
| 69 | TEST_F(WhileUtilTest, MakeZeroInstructionsLiveOp) { |
| 70 | HloInstruction *param0, *param1, *param2; |
| 71 | HloComputation* entry_computation; |
| 72 | |
| 73 | TF_ASSERT_OK_AND_ASSIGN( |
| 74 | auto module, |
| 75 | GetParsedModule(&entry_computation, ¶m0, ¶m1, ¶m2)); |
| 76 | |
| 77 | HloInstruction* while_instr = entry_computation->root_instruction(); |
| 78 | ASSERT_EQ(while_instr->opcode(), HloOpcode::kWhile); |
| 79 | |
| 80 | TF_ASSERT_OK_AND_ASSIGN( |
| 81 | WhileUtil::MakeInstructionsLiveInResult make_live_in_result, |
| 82 | WhileUtil::MakeInstructionsLiveIn(while_instr, /*instructions=*/{})); |
| 83 | |
| 84 | HloInstruction* new_while_instr = make_live_in_result.new_while_instr; |
| 85 | |
| 86 | EXPECT_THAT( |
| 87 | entry_computation->root_instruction(), |
| 88 | op::Tuple(op::GetTupleElement(::testing::Eq(new_while_instr), 0), |
| 89 | op::GetTupleElement(::testing::Eq(new_while_instr), 1))); |
| 90 | |
| 91 | auto param_reconstructed = |
| 92 | op::Tuple(op::GetTupleElement(op::Parameter(0), 0), |
| 93 | op::GetTupleElement(op::Parameter(0), 1)); |
| 94 | |
| 95 | EXPECT_THAT(new_while_instr->while_body()->root_instruction(), |
| 96 | op::Tuple(op::GetTupleElement(param_reconstructed, 0), |
| 97 | op::GetTupleElement(param_reconstructed, 1))); |
| 98 | } |
| 99 | |
| 100 | TEST_F(WhileUtilTest, MakeTwoInstructionsLive) { |
| 101 | HloInstruction *param0, *param1, *param2; |
nothing calls this directly
no test coverage detected