| 40 | } |
| 41 | |
| 42 | void Match(const std::string& original, IRContext* context, |
| 43 | bool do_validation = true) { |
| 44 | std::vector<uint32_t> bin; |
| 45 | context->module()->ToBinary(&bin, true); |
| 46 | if (do_validation) { |
| 47 | EXPECT_TRUE(Validate(bin)); |
| 48 | } |
| 49 | std::string assembly; |
| 50 | SpirvTools tools(SPV_ENV_UNIVERSAL_1_2); |
| 51 | EXPECT_TRUE( |
| 52 | tools.Disassemble(bin, &assembly, SPV_BINARY_TO_TEXT_OPTION_NO_HEADER)) |
| 53 | << "Disassembling failed for shader:\n" |
| 54 | << assembly << std::endl; |
| 55 | auto match_result = effcee::Match(assembly, original); |
| 56 | EXPECT_EQ(effcee::Result::Status::Ok, match_result.status()) |
| 57 | << match_result.message() << "\nChecking result:\n" |
| 58 | << assembly; |
| 59 | } |
| 60 | |
| 61 | using LCSSATest = ::testing::Test; |
| 62 |
no test coverage detected