| 188 | using ParseDefUseTest = ::testing::TestWithParam<ParseDefUseCase>; |
| 189 | |
| 190 | TEST_P(ParseDefUseTest, Case) { |
| 191 | const auto& tc = GetParam(); |
| 192 | |
| 193 | // Build module. |
| 194 | const std::vector<const char*> text = {tc.text}; |
| 195 | std::unique_ptr<IRContext> context = |
| 196 | BuildModule(SPV_ENV_UNIVERSAL_1_1, nullptr, JoinAllInsts(text), |
| 197 | SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS); |
| 198 | ASSERT_NE(nullptr, context); |
| 199 | |
| 200 | // Analyze def and use. |
| 201 | DefUseManager manager(context->module()); |
| 202 | |
| 203 | CheckDef(tc.du, manager.id_to_defs()); |
| 204 | CheckUse(tc.du, &manager, context->module()->IdBound()); |
| 205 | } |
| 206 | |
| 207 | // clang-format off |
| 208 | INSTANTIATE_TEST_SUITE_P( |
nothing calls this directly
no test coverage detected