Disassembles the given |module| and returns the disassembly.
| 590 | |
| 591 | // Disassembles the given |module| and returns the disassembly. |
| 592 | std::string DisassembleModule(Module* module) { |
| 593 | SpirvTools tools(SPV_ENV_UNIVERSAL_1_1); |
| 594 | |
| 595 | std::vector<uint32_t> binary; |
| 596 | module->ToBinary(&binary, /* skip_nop = */ false); |
| 597 | |
| 598 | std::string text; |
| 599 | // We'll need to check the underlying id numbers. |
| 600 | // So turn off friendly names for ids. |
| 601 | tools.Disassemble(binary, &text, SPV_BINARY_TO_TEXT_OPTION_NO_HEADER); |
| 602 | while (!text.empty() && text.back() == '\n') text.pop_back(); |
| 603 | return text; |
| 604 | } |
| 605 | |
| 606 | TEST_P(ReplaceUseTest, Case) { |
| 607 | const auto& tc = GetParam(); |