Update spirv-tools to v2021.4 (#4862)

This commit is contained in:
Ben Doherty
2021-11-16 17:13:42 -08:00
committed by GitHub
parent a29b438161
commit 9d29d2e32c
529 changed files with 26363 additions and 5855 deletions

View File

@@ -16,16 +16,18 @@
#include <vector>
#include "spirv-tools/libspirv.hpp"
#include "test/fuzzers/random_generator.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
if (size < sizeof(spv_target_env) + 1) return 0;
if (size < 1) {
return 0;
}
const spv_context context =
spvContextCreate(*reinterpret_cast<const spv_target_env*>(data));
if (context == nullptr) return 0;
data += sizeof(spv_target_env);
size -= sizeof(spv_target_env);
spvtools::fuzzers::RandomGenerator random_gen(data, size);
const spv_context context = spvContextCreate(random_gen.GetTargetEnv());
if (context == nullptr) {
return 0;
}
std::vector<uint32_t> input;
input.resize(size >> 2);