llvm.org GIT mirror llvm / cf02f1a
Add wildcard support to all update_*_test_checks.py scripts (PR37500) 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355386 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 7 months ago
4 changed file(s) with 12 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
3131 from __future__ import print_function
3232
3333 import argparse
34 import glob
3435 import itertools
3536 import os # Used to advertise this file's name ("autogenerated_note").
3637 import string
4647 # RegEx: this is where the magic happens.
4748
4849 IR_FUNCTION_RE = re.compile('^\s*define\s+(?:internal\s+)?[^@]*@([\w-]+)\s*\(')
49
50
51
52
5350
5451 def main():
5552 from argparse import RawTextHelpFormatter
7067 print('ERROR: Unexpected opt name: ' + opt_basename, file=sys.stderr)
7168 sys.exit(1)
7269
73 for test in args.tests:
70 test_paths = [test for pattern in args.tests for test in glob.glob(pattern)]
71 for test in test_paths:
7472 if args.verbose:
7573 print('Scanning for RUN lines in test file: %s' % (test,), file=sys.stderr)
7674 with open(test) as f:
99 from __future__ import print_function
1010
1111 import argparse
12 import glob
1213 import os # Used to advertise this file's name ("autogenerated_note").
1314 import string
1415 import subprocess
4142
4243 autogenerated_note = (ADVERT + 'utils/' + os.path.basename(__file__))
4344
44 for test in args.tests:
45 test_paths = [test for pattern in args.tests for test in glob.glob(pattern)]
46 for test in test_paths:
4547 if args.verbose:
4648 print('Scanning for RUN lines in test file: %s' % (test,), file=sys.stderr)
4749 with open(test) as f:
2020
2121 import argparse
2222 import collections
23 import glob
2324 import os
2425 import re
2526 import subprocess
425426 parser.add_argument('tests', nargs='+')
426427 args = parser.parse_args()
427428
428 for test in args.tests:
429 test_paths = [test for pattern in args.tests for test in glob.glob(pattern)]
430 for test in test_paths:
429431 try:
430432 update_test_file(args.llc, test, args.remove_common_prefixes,
431433 verbose=args.verbose)
3131 from __future__ import print_function
3232
3333 import argparse
34 import glob
3435 import itertools
3536 import os # Used to advertise this file's name ("autogenerated_note").
3637 import string
7071 print('ERROR: Unexpected opt name: ' + opt_basename, file=sys.stderr)
7172 sys.exit(1)
7273
73 for test in args.tests:
74 test_paths = [test for pattern in args.tests for test in glob.glob(pattern)]
75 for test in test_paths:
7476 if args.verbose:
7577 print('Scanning for RUN lines in test file: %s' % (test,), file=sys.stderr)
7678 with open(test) as f: