aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/update_cc_test_checks.py
diff options
context:
space:
mode:
authorJon Roelofs <jonathan_roelofs@apple.com>2021-03-08 17:26:24 -0800
committerJon Roelofs <jonathan_roelofs@apple.com>2021-03-08 17:26:24 -0800
commita24644bb1ce09b40c2d751569dd5bb37ea9c995d (patch)
tree27005f8e6e8b110c523b9010fac4df97c2fd171a /llvm/utils/update_cc_test_checks.py
parentf0ccdde3c9ab23f997a4a30a0e9ab7d9435ec1c6 (diff)
downloadllvm-a24644bb1ce09b40c2d751569dd5bb37ea9c995d.zip
llvm-a24644bb1ce09b40c2d751569dd5bb37ea9c995d.tar.gz
llvm-a24644bb1ce09b40c2d751569dd5bb37ea9c995d.tar.bz2
Revert "Run non-filechecked commands in update_cc_test_checks.py"
This reverts commit 60d4c73b30a0e324c6ae314722eb036f70f4b03a. The new test is broken on macos hosts. Discussion here: https://reviews.llvm.org/D97068#2611269 https://reviews.llvm.org/D97068#2612675 ... revert to green.
Diffstat (limited to 'llvm/utils/update_cc_test_checks.py')
-rwxr-xr-xllvm/utils/update_cc_test_checks.py36
1 files changed, 11 insertions, 25 deletions
diff --git a/llvm/utils/update_cc_test_checks.py b/llvm/utils/update_cc_test_checks.py
index d084bc6..e5ca915 100755
--- a/llvm/utils/update_cc_test_checks.py
+++ b/llvm/utils/update_cc_test_checks.py
@@ -203,14 +203,6 @@ def get_function_body(builder, args, filename, clang_args, extra_commands,
'are discouraged in Clang testsuite.', file=sys.stderr)
sys.exit(1)
-def exec_run_line(exe):
- 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)
def main():
initial_args, parser = config()
@@ -229,31 +221,25 @@ def main():
if m:
triple_in_cmd = m.groups()[0]
- # Parse executable args.
- exec_args = shlex.split(commands[0])
- # Execute non-clang runline.
- if exec_args[0] not in SUBST:
- print('NOTE: Executing non-clang RUN line: ' + l, file=sys.stderr)
- # Replace %s by `filename`.
- exec_args = [i.replace('%s', ti.path) if '%s' in i else i for i in exec_args]
- exec_run_line(exec_args)
+ # Apply %clang substitution rule, replace %s by `filename`, and append args.clang_args
+ clang_args = shlex.split(commands[0])
+ if clang_args[0] not in SUBST:
+ print('WARNING: Skipping non-clang RUN line: ' + l, file=sys.stderr)
continue
- # This is a clang runline, apply %clang substitution rule, replace %s by `filename`,
- # and append args.clang_args
- clang_args = exec_args
clang_args[0:1] = SUBST[clang_args[0]]
- clang_args = [i.replace('%s', ti.path) if '%s' in i else i for i in clang_args] + ti.args.clang_args
+ clang_args = [ti.path if i == '%s' else i for i in clang_args] + ti.args.clang_args
+
+ # Permit piping the output through opt
+ if not (len(commands) == 2 or
+ (len(commands) == 3 and commands[1].startswith('opt'))):
+ print('WARNING: Skipping non-clang RUN line: ' + l, file=sys.stderr)
# Extract -check-prefix in FileCheck args
filecheck_cmd = commands[-1]
common.verify_filecheck_prefixes(filecheck_cmd)
if not filecheck_cmd.startswith('FileCheck '):
- print('NOTE: Executing non-FileChecked clang RUN line: ' + l, file=sys.stderr)
- # Execute non-filechecked clang runline.
- exe = [ti.args.clang] + clang_args
- exec_run_line(exe)
+ print('WARNING: Skipping non-FileChecked RUN line: ' + l, file=sys.stderr)
continue
-
check_prefixes = [item for m in common.CHECK_PREFIX_RE.finditer(filecheck_cmd)
for item in m.group(1).split(',')]
if not check_prefixes: