diff --git a/fuzzers/tint_ast_clone_fuzzer.cc b/fuzzers/tint_ast_clone_fuzzer.cc index ff72174609..f7eb93b831 100644 --- a/fuzzers/tint_ast_clone_fuzzer.cc +++ b/fuzzers/tint_ast_clone_fuzzer.cc @@ -16,6 +16,7 @@ #include #include +#include "src/demangler.h" #include "src/reader/wgsl/parser_impl.h" #include "src/writer/wgsl/generator.h" @@ -57,8 +58,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { // Clone the src module to dst auto dst = src.Clone(); - // Expect the AST printed with to_str() to match - ASSERT_EQ(src.to_str(), dst.to_str()); + // Expect the demangled AST printed with to_str() to match + tint::Demangler d; + ASSERT_EQ(d.Demangle(src, src.to_str()), d.Demangle(dst, dst.to_str())); // Check that none of the AST nodes or type pointers in dst are found in src std::unordered_set src_nodes;