mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-08 21:17:45 +00:00
Adding fuzzing for Transforms
Fuzz all transforms being applied together, and fuzz each transform separately. BUG=tint:436 Change-Id: I53cf2e05c69f495f27bfa428f55ec033a85a612a Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/36945 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Auto-Submit: Ryan Harrison <rharrison@chromium.org> Reviewed-by: David Neto <dneto@google.com> Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
39545b7e7c
commit
4a29008c7e
32
fuzzers/tint_bound_array_accessors_fuzzer.cc
Normal file
32
fuzzers/tint_bound_array_accessors_fuzzer.cc
Normal file
@@ -0,0 +1,32 @@
|
||||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "fuzzers/tint_common_fuzzer.h"
|
||||
|
||||
namespace tint {
|
||||
namespace fuzzers {
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
tint::transform::Manager transform_manager;
|
||||
transform_manager.append(
|
||||
std::make_unique<tint::transform::BoundArrayAccessors>());
|
||||
|
||||
tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kSpv);
|
||||
fuzzer.SetTransformManager(&transform_manager);
|
||||
|
||||
return fuzzer.Run(data, size);
|
||||
}
|
||||
|
||||
} // namespace fuzzers
|
||||
} // namespace tint
|
||||
Reference in New Issue
Block a user