MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / Match

Function Match

test/opt/loop_optimizations/lcssa.cpp:42–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42void 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
61using LCSSATest = ::testing::Test;
62

Callers 1

TEST_FFunction · 0.70

Calls 4

ValidateFunction · 0.70
ToBinaryMethod · 0.45
moduleMethod · 0.45
DisassembleMethod · 0.45

Tested by

no test coverage detected