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

Function Validate

test/opt/ir_builder.cpp:35–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 4

MatchFunction · 0.70
ValidateMethod · 0.50
TEST_FFunction · 0.50
TEST_FFunction · 0.50

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 1

TEST_FFunction · 0.40