[spirv] Check remapped_entry_point_name in fuzzer
If it is provided, it must not be empty.
Bug: 383200047
Change-Id: I5f985d06c4132058e740e181492202b2e9b28884
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/218814
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: James Price <jrprice@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/lang/spirv/writer/writer_fuzz.cc b/src/tint/lang/spirv/writer/writer_fuzz.cc
index 857ef02..1f7d866 100644
--- a/src/tint/lang/spirv/writer/writer_fuzz.cc
+++ b/src/tint/lang/spirv/writer/writer_fuzz.cc
@@ -37,7 +37,12 @@
namespace tint::spirv::writer {
namespace {
-bool CanRun(const core::ir::Module& module) {
+bool CanRun(const core::ir::Module& module, const Options& options) {
+ // If a remapped entry point name is provided, it must not be empty.
+ if (options.remapped_entry_point_name && options.remapped_entry_point_name->empty()) {
+ return false;
+ }
+
// Check for unsupported module-scope variable address spaces and types.
for (auto* inst : *module.root_block) {
auto* var = inst->As<core::ir::Var>();
@@ -50,7 +55,7 @@
}
Result<SuccessType> IRFuzzer(core::ir::Module& module, const fuzz::ir::Context&, Options options) {
- if (!CanRun(module)) {
+ if (!CanRun(module, options)) {
return Failure{"Cannot run module"};
}