summaryrefslogtreecommitdiffstats
path: root/llvm/utils/update_cc_test_checks.py
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/update_cc_test_checks.py')
-rwxr-xr-xllvm/utils/update_cc_test_checks.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/utils/update_cc_test_checks.py b/llvm/utils/update_cc_test_checks.py
index 205b57698da..d4eb9f2ca1b 100755
--- a/llvm/utils/update_cc_test_checks.py
+++ b/llvm/utils/update_cc_test_checks.py
@@ -86,6 +86,8 @@ def config():
parser.add_argument(
'--x86_extra_scrub', action='store_true',
help='Use more regex for x86 matching to reduce diffs between various subtargets')
+ parser.add_argument('-u', '--update-only', action='store_true',
+ help='Only update test if it was already autogened')
parser.add_argument('tests', nargs='+')
args = parser.parse_args()
args.clang_args = shlex.split(args.clang_args or '')
@@ -126,11 +128,22 @@ def get_function_body(args, filename, clang_args, prefixes, triple_in_cmd, func_
def main():
args = config()
- autogenerated_note = (ADVERT + 'utils/' + os.path.basename(__file__))
+ script_name = os.path.basename(__file__)
+ autogenerated_note = (ADVERT + 'utils/' + script_name)
for filename in args.tests:
with open(filename) as f:
input_lines = [l.rstrip() for l in f]
+
+ first_line = input_lines[0] if input_lines else ""
+ if 'autogenerated' in first_line and script_name not in first_line:
+ common.warn("Skipping test which wasn't autogenerated by " + script_name, filename)
+ continue
+
+ if args.update_only:
+ if not first_line or 'autogenerated' not in first_line:
+ common.warn("Skipping test which isn't autogenerated: " + filename)
+ continue
# Extract RUN lines.
raw_lines = [m.group(1)
OpenPOWER on IntegriCloud