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

Function Validate

test/opt/loop_optimizations/nested_loops.cpp:36–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34using ::testing::UnorderedElementsAre;
35
36bool Validate(const std::vector<uint32_t>& bin) {
37 spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2;
38 spv_context spvContext = spvContextCreate(target_env);
39 spv_diagnostic diagnostic = nullptr;
40 spv_const_binary_t binary = {bin.data(), bin.size()};
41 spv_result_t error = spvValidate(spvContext, &binary, &diagnostic);
42 if (error != 0) spvDiagnosticPrint(diagnostic);
43 spvDiagnosticDestroy(diagnostic);
44 spvContextDestroy(spvContext);
45 return error == 0;
46}
47
48using PassClassTest = PassTest<::testing::Test>;
49

Callers 1

TEST_FFunction · 0.70

Calls 7

spvContextCreateFunction · 0.85
spvValidateFunction · 0.85
spvDiagnosticPrintFunction · 0.85
spvDiagnosticDestroyFunction · 0.85
spvContextDestroyFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected