[PATCH] D112936: [Docs] Document scripts that are use to generate assertion in test cases
Shivam Gupta via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 2 19:00:58 PDT 2021
xgupta updated this revision to Diff 384300.
xgupta added a comment.
address comments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112936/new/
https://reviews.llvm.org/D112936
Files:
llvm/docs/TestingGuide.rst
Index: llvm/docs/TestingGuide.rst
===================================================================
--- llvm/docs/TestingGuide.rst
+++ llvm/docs/TestingGuide.rst
@@ -275,6 +275,44 @@
test. Check if there are files already covering your feature and consider
adding your code there instead of creating a new file.
+Generating assertions in regression tests
+-----------------------------------------
+
+Some regression test cases are very large and complex to write/update by hand.
+In that case to reduce the human work we can use the scripts available in
+llvm/utils/ to generate the assertions.
+
+For example to generate assertions in an :program:`llc`-based test, run:
+
+ .. code-block:: bash
+
+ % llvm/utils/update_llc_test_checks.py --llc-binary build/bin/llc test.ll
+
+And if you want to update assertions in an existing test case, pass `-u` option
+which first check the NOTE: line exists and matches the script name.
+
+Most common scripts and their purposes or applications in generating assertions:
+
+.. code-block::
+
+ update_analyze_test_checks.py
+ opt --analyze --costmodel
+
+ update_cc_test_checks.py
+ C/C++, or clang/clang++
+
+ update_llc_test_checks.py
+ llc (assembly checks)
+
+ update_mca_test_checks.py
+ llvm-mca
+
+ update_mir_test_checks.py
+ llc (MIR checks)
+
+ update_test_checks.py
+ opt
+
Extra files
-----------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112936.384300.patch
Type: text/x-patch
Size: 1376 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211103/0535a1c0/attachment.bin>
More information about the llvm-commits
mailing list