[PATCH] D97068: Run non-filechecked commands in update_cc_test_checks.py

Giorgis Georgakoudis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 10:57:19 PST 2021


ggeorgakoudis created this revision.
ggeorgakoudis requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97068

Files:
  llvm/utils/update_cc_test_checks.py


Index: llvm/utils/update_cc_test_checks.py
===================================================================
--- llvm/utils/update_cc_test_checks.py
+++ llvm/utils/update_cc_test_checks.py
@@ -238,7 +238,16 @@
       filecheck_cmd = commands[-1]
       common.verify_filecheck_prefixes(filecheck_cmd)
       if not filecheck_cmd.startswith('FileCheck '):
-        print('WARNING: Skipping non-FileChecked RUN line: ' + l, file=sys.stderr)
+        print('NOTE: Executing in-place non-FileChecked RUN line: ' + l, file=sys.stderr)
+        # Run command in place
+        exe = [ti.args.clang] + clang_args
+        popen = subprocess.Popen(exe, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
+        stdout, stderr = popen.communicate()
+        if popen.returncode != 0:
+          sys.stderr.write('Failed to run ' + ' '.join(exe) + '\n')
+          sys.stderr.write(stderr)
+          sys.stderr.write(stdout)
+          sys.exit(3)
         continue
       check_prefixes = [item for m in common.CHECK_PREFIX_RE.finditer(filecheck_cmd)
                                for item in m.group(1).split(',')]


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97068.325040.patch
Type: text/x-patch
Size: 1136 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210219/24bd6250/attachment.bin>


More information about the llvm-commits mailing list