diff --git a/clang/docs/tools/dump_ast_matchers.py b/clang/docs/tools/dump_ast_matchers.py index 5db6826070934..f263fc271b6cb 100755 --- a/clang/docs/tools/dump_ast_matchers.py +++ b/clang/docs/tools/dump_ast_matchers.py @@ -6,6 +6,7 @@ import collections import re import os +import sys from urllib.request import urlopen @@ -612,5 +613,7 @@ def sort_table(matcher_type, matcher_map): flags=re.S, ) -with open(HTML_FILE, "w", newline="\n") as output: +output_file = sys.argv[1] if len(sys.argv) == 2 else HTML_FILE + +with open(output_file, "w", newline="\n") as output: output.write(reference) diff --git a/clang/test/AST/ast_matchers_updated.test b/clang/test/AST/ast_matchers_updated.test new file mode 100644 index 0000000000000..0eba16a1a5c00 --- /dev/null +++ b/clang/test/AST/ast_matchers_updated.test @@ -0,0 +1,4 @@ +// FIXME enable windows +// UNSUPPORTED: system-windows +// RUN: %python %S/../../docs/tools/dump_ast_matchers.py %t +// RUN: diff %t %S/../../docs/LibASTMatchersReference.html