summaryrefslogtreecommitdiffstats
path: root/llvm/utils/update_test_checks.py
Commit message (Collapse)AuthorAgeFilesLines
* [Utils] Allow update_test_checks to scrub attribute annotationsJohannes Doerfert2019-12-311-0/+9
| | | | | | | | | Attribute annotations on calls, e.g., #0, are not useful on their own. This patch adds a flag to update_test_checks.py to scrub them. Reviewed By: lebedev.ri Differential Revision: https://reviews.llvm.org/D68851
* [UpdateTestChecks] Change shebang from python to python3Fangrui Song2019-12-031-1/+1
| | | | | | | | | | 'python' means Python 2 on some platforms while Python 3 on others. 'python3' is Python 3 only. Python 2.7 End of Life is set to January 1, 2020. Getting rid of Python 2 support reduces maintenance burden. Reviewed By: lebedev.ri Differential Revision: https://reviews.llvm.org/D70730
* [UpdateTestChecks] Share the code to parse RUN: lines between all scriptsAlex Richardson2019-12-021-23/+5
| | | | | | | | | | | | | | | | Summary: This commit also introduces a common.debug() function to avoid many `if args.verbose:` statements. Depends on D70428. Reviewers: xbolva00, MaskRay, jdoerfert Reviewed By: MaskRay Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70432
* [UptestTestChecks][NFC] Share some common command line options codeAlex Richardson2019-11-201-5/+1
| | | | | | | | | | | | | | | | | | | Summary: Add a function common.parse_commandline_args() that adds options common to all tools (--verbose and --update-only) and returns the parsed commandline arguments. I plan to use the shared parsing of --verbose in a follow-up commit to remove most of the `if args.verbose:` checks in the scripts. Reviewers: xbolva00, MaskRay Reviewed By: MaskRay Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70428
* [Utils] Hide the default behavior change of D68819 under a flagJohannes Doerfert2019-11-011-1/+1
| | | | | | With D69701, the options used when running the script on a file will be recorded and reused on a rerun. This allows us to hide new features behind flags, starting with the "define" that was introduced in D68819.
* [Utils] Allow update_test_checks to check function informationJohannes Doerfert2019-10-301-1/+4
| | | | | | | | | | | | | | | | | | | Summary: This adds a switch to the update_test_checks that triggers arguments and other function annotations, e.g., personality, to be present in the check line. If not set, the behavior should be the same as before. If arguments are recorded, their names are scrubbed from the IR to allow merging. This patch includes D68153. Reviewers: lebedev.ri, greened, spatel, xbolva00, RKSimon, mehdi_amini Subscribers: bollu, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68819
* Allow update_test_checks.py to not scrub names.David Greene2019-10-071-1/+4
| | | | | | | | | | Add a --preserve-names option to tell the script not to replace IR names. Sometimes tests want those names. For example if a test is looking for a modification to an existing instruction we'll want to make the names. Differential Revision: https://reviews.llvm.org/D68081 llvm-svn: 373912
* [UpdateTestChecks] Fix wildcard support on DOS promptsSimon Pilgrim2019-09-271-3/+3
| | | | | | D64572 / rL365818 changed the way that the file paths were collected, which meant we lost the file pattern expansion necessary when working with DOS command prompt llvm-svn: 373062
* [UpdateTestChecks] Update tests optionDavid Bolvansky2019-08-071-9/+15
| | | | | | | | | | | | | | | | | | | | | Summary: Port of new feature introduced https://reviews.llvm.org/D65610 to other update scripts. - update_*_checks.py: add an alias -u for --update-only - port --update-only to other update_*_test_checks.py scripts - update script aborts if the test file was generated by another update_*_test_checks.py utility Reviewers: lebedev.ri, RKSimon, MaskRay, reames, gbedwell Reviewed By: MaskRay Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65793 llvm-svn: 368174
* [UpdateTestChecks] Fix an incorrect %s added in r368006Fangrui Song2019-08-061-1/+1
| | | | llvm-svn: 368007
* [UpdateTestChecks] Apply some string concatenation cleanupFangrui Song2019-08-061-8/+8
| | | | | | Some were what I suggested in D65610. llvm-svn: 368006
* Robustify update_test_checks.py to non-autogened tests, and add a mode to ↵Philip Reames2019-08-051-0/+11
| | | | | | | | | | | | skip non-autogenerated ones Intended use case is: ./utils/update_test_checks.py test/Transform/PassDir/* --update-only (i.e. rapidly be able to see changes in autogened filed, before handing non-autogened tests individually) Differential Revision: https://reviews.llvm.org/D65610 llvm-svn: 367900
* [UpdateTestChecks] Emit warning when invalid value for -check-prefix(es) optionDavid Bolvansky2019-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The script is silent for the following issue: FileCheck %s -check-prefix=CHECK,POPCOUNT FileCheck will catch it later, but I think we can warn here too. Now it warns: ./update_llc_test_checks.py file.ll WARNING: Supplied prefix 'CHECK,POPCOUNT' is invalid. Prefix must contain only alphanumeric characters, hyphens and underscores. Did you mean --check-prefixes=CHECK,POPCOUNT? Reviewers: lebedev.ri, spatel, RKSimon, craig.topper, nikic, gbedwell Reviewed By: RKSimon Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64589 llvm-svn: 367244
* [UpdateTestChecks] Emit warning when invalid test pathsDavid Bolvansky2019-07-111-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Recently I ran into the following issue: ./update_test_checks.py /path/not-existing-file.ll The script was silent and I was suprised why the real test file hadn't been updated. Solution: Emit warning if we detect this problem. Reviewers: lebedev.ri, spatel, jdoerfert, nikic Reviewed By: lebedev.ri, spatel, jdoerfert, nikic Subscribers: jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64572 llvm-svn: 365818
* [utils] update_test_checks.py: allow opt-8, opt-9Fangrui Song2019-05-121-1/+2
| | | | | | | | | | Allow using Debian's opt-8, opt-9 with update_test_checks.py Patch by Shawn Landden! Differential Revision: https://reviews.llvm.org/D61148 llvm-svn: 360536
* Add wildcard support to all update_*_test_checks.py scripts (PR37500)Simon Pilgrim2019-03-051-1/+3
| | | | | | | | We can already update multiple files in each update call, this extends it to work with wildcards as well in the same way as update_mca_test_checks.py (to support shells that won't do this for us - windows command prompt etc.) Differential Revision: https://reviews.llvm.org/D58817 llvm-svn: 355386
* [utils] Fix update scripts output when run on python3.Simon Pilgrim2019-01-301-1/+1
| | | | | | This fixes a "bytes-like object is required, not 'str'" python3 error I hit on update_llc_test_checks.py (but present on the other scripts as well) by matching what update_mca_test_checks.py already does, plus I've added an explicit 'utf-8' encoding. llvm-svn: 352633
* Python compat - no explicit reference to Python versionSerge Guelton2019-01-031-1/+1
| | | | | | | | Update documentation and shebang. Differential Revision: https://reviews.llvm.org/D56252 llvm-svn: 350327
* Python compat - print statementSerge Guelton2019-01-031-10/+12
| | | | | | | | | Make sure all print statements are compatible with Python 2 and Python3 using the `from __future__ import print_function` statement. Differential Revision: https://reviews.llvm.org/D56249 llvm-svn: 350307
* [UpdateTestChecks] Remove unnecessary return from add_ir_checksSimon Pilgrim2018-04-051-1/+1
| | | | llvm-svn: 329262
* Fix LLVM IR check lines in utils/update_cc_test_checks.pyFangrui Song2018-03-141-1/+1
| | | | | | | | | | Reviewers: arichardson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44400 llvm-svn: 327538
* [utils] Refactor utils/update_{,llc_}test_checks.py to share more codeFangrui Song2018-02-101-127/+4
| | | | | | | | | | | | | | Summary: This revision refactors 1. parser 2. CHECK line adder of utils/update_{,llc_}test_checks.py so that thir functionality can be re-used by other utility scripts (e.g. D42712) Reviewers: asb, craig.topper, RKSimon, echristo Subscribers: llvm-commits, spatel Differential Revision: https://reviews.llvm.org/D42805 llvm-svn: 324803
* [utils] De-duplicate utils/update_{llc_,}test_checks.pyFangrui Song2018-01-301-70/+16
| | | | | | | | Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42654 llvm-svn: 323718
* [utils] remove ability to generate llc check lines from update_test_checks.pySanjay Patel2017-06-121-69/+27
| | | | | | | | | The dream of a unified check-line auto-generator for all phases of compilation is dead. The llc script has already diverged to be better at its goal, so having 2 scripts that do almost the same thing just causes confusion. Now, this script will only work with opt to produce check lines for IR transforms. llvm-svn: 305208
* Update update_test_checks so that . is a valid identifier character in ↵Daniel Berlin2017-01-151-1/+1
| | | | | | addition to _ llvm-svn: 292056
* [utils] Improve extraction of check prefixes from RUN linesNikolai Bozhenov2017-01-141-3/+3
| | | | | | | | | | | | Correct handling of the following FileCheck options is implemented in update_llc_test_checks.py and update_test_checks.py scripts: 1) -check-prefix (with a single dash) 2) -check-prefixes (with multiple prefixes) Differential Revision: https://reviews.llvm.org/D28572 llvm-svn: 292008
* Fix update_test_checks not to accidentally believe type names are variable namesDaniel Berlin2017-01-131-1/+1
| | | | llvm-svn: 291980
* Fix function regex in update_tests so it can handle {}'s in function argsDaniel Berlin2017-01-091-1/+1
| | | | llvm-svn: 291467
* Update update_test_checks to work properly with phi nodes and other fun things.Daniel Berlin2017-01-071-23/+26
| | | | | | | | | | | | | | | | | | | | | | Summary: Prior to this change, phi nodes were never considered defs, and so we ended up with undefined variables for any loop. Now, instead of trying to find just defs, we iterate over each actual IR value in the line, and replace them one by one with either a definition or a use. We also don't try to match anything in the comment portions of the line. I've tested it even on things like function pointer calls, etc, and against existing test cases uses update_test_checks With this change, we are able to use update_tests on the cyclic cases in newgvn. The only case i'm aware of that will misfire is if you have a string with which contains a valid token. However, this is the same as it is now, with a slightly larger set of strings that may misfire. Prior to this change, a test with the string " %a =" would be replaced. Reviewers: spatel, chandlerc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28384 llvm-svn: 291357
* Fix indentation in r290716.Bryant Wong2016-12-291-4/+4
| | | | | | Use two-space indentation like the rest of the file. llvm-svn: 290722
* Correctly handle multi-lined RUN lines.Bryant Wong2016-12-291-1/+8
| | | | | | | | | | `utils/update_{llc_test,test}_checks` ought to be able to handle RUN commands that span multiple lines, as shown in the example at http://llvm.org/docs/CommandGuide/FileCheck.html#the-filecheck-check-prefix-option Differential Revision: https://reviews.llvm.org/D26523 llvm-svn: 290716
* Fix `update_test_checks.py` bug that incorrectly truncates IR body.Bryant Wong2016-12-251-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D26619 llvm-svn: 290529
* [X86][AVX512] Add support for masked shuffle commentsSimon Pilgrim2016-07-031-1/+1
| | | | | | | | | | This patch adds support for including the avx512 mask register information in the mask/maskz versions of shuffle instruction comments. This initial version just adds support for MOVDDUP/MOVSHDUP/MOVSLDUP to reduce the mass of test regenerations, other shuffle instructions can be added in due course. Differential Revision: http://reviews.llvm.org/D21953 llvm-svn: 274459
* [X86] Updated test checks script to generalise LCPI symbol refsSimon Pilgrim2016-06-111-0/+3
| | | | | | | | The script now replace '.LCPI888_8' style asm symbols with the {{\.LCPI.*}} re pattern - this helps stop hardcoded symbols in 32-bit x86 tests changing with every edit of the file Refreshed some tests to demonstrate the new check llvm-svn: 272488
* fixed to discard earlier advertisingSanjay Patel2016-04-051-3/+4
| | | | | | | Also, hardcode (there must be a better way...) the 'utils' dir in the advertisement, so it's easier to find. llvm-svn: 265444
* add example usage and workflow to --help outputSanjay Patel2016-04-051-2/+25
| | | | llvm-svn: 265430
* check or check-next the first line of the function tooSanjay Patel2016-04-051-5/+15
| | | | | | | | | | | | | | | | We could make this an option if people don't like it. But since part of the reason for using a script to generate checks is to prevent lazy checking that lets bugs crawl through, let's have the script check the first line too. For asm tests, it ensures that nothing unexpected has happened before the first line of asm. This matches the existing behavior of update_llc_test_checks.py. More discussion in PR22897: https://llvm.org/bugs/show_bug.cgi?id=22897 llvm-svn: 265414
* workaround for an IR variable named %.Sanjay Patel2016-03-271-0/+2
| | | | | | (which SimplifyCFG can produce...) llvm-svn: 264543
* add scrubber for excessive leading whitespaceSanjay Patel2016-03-271-0/+3
| | | | llvm-svn: 264542
* fix IR function name regex to allow hyphensSanjay Patel2016-03-251-2/+2
| | | | llvm-svn: 264422
* Add utility script to generate checks for opt or llc regression testsSanjay Patel2016-03-241-0/+355
This is an enhancement of the existing update_llc_test_checks.py script. It adds some of the functionality from the script used in D17999 to make the IR checking more flexible. The bad news: This actually is 'My First Python Program'. Thus, it's likely that I have violated all best practices of Python programming if I've made a functional change from the original program. If you see anything that's obviously wrong, please let me know or feel free to fix it. I didn't even read any documentation... The good news: I tested this on ~10 existing opt/llc regression tests, and it does what I hoped for. It produces exact checking for IR regression tests and doesn't signficantly change the existing llc-with-x86-target asm checking. The opt tests that were modified in r263667, r263668, r263674, and r263679 are examples of the expected results, except that this version of the script puts the check lines ahead of the IR to follow the existing llc/asm behavior. If there are no complaints/fallout, we should be able to remove the original script. Extending this script to be used for non-x86 and clang regression tests would be the expected follow-up steps. llvm-svn: 264357
OpenPOWER on IntegriCloud