diff options
Diffstat (limited to 'llvm/utils/UpdateTestChecks/common.py')
-rw-r--r-- | llvm/utils/UpdateTestChecks/common.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py index 20b189a..10859960 100644 --- a/llvm/utils/UpdateTestChecks/common.py +++ b/llvm/utils/UpdateTestChecks/common.py @@ -29,8 +29,14 @@ def should_add_line_to_output(input_line, prefix_set): # Invoke the tool that is being tested. def invoke_tool(exe, cmd_args, ir): with open(ir) as ir_file: - stdout = subprocess.check_output(exe + ' ' + cmd_args, - shell=True, stdin=ir_file) + # TODO Remove the str form which is used by update_test_checks.py and + # update_llc_test_checks.py + # The safer list form is used by update_cc_test_checks.py + if isinstance(cmd_args, list): + stdout = subprocess.check_output([exe] + cmd_args, stdin=ir_file) + else: + stdout = subprocess.check_output(exe + ' ' + cmd_args, + shell=True, stdin=ir_file) if sys.version_info[0] > 2: stdout = stdout.decode() # Fix line endings to unix CR style. |