summaryrefslogtreecommitdiffstats
path: root/llvm/utils/update_llc_test_checks.py
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2016-01-27 21:13:18 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2016-01-27 21:13:18 +0000
commit6b6dcc448ab4d297723c0173c7aa6fb44e9d94eb (patch)
treedcac1db4c5a08a411b97b38a8f60bb22e9ae79c2 /llvm/utils/update_llc_test_checks.py
parent749b4d51ede0c74e4e8a051cb158b24c75b71cef (diff)
downloadbcm5719-llvm-6b6dcc448ab4d297723c0173c7aa6fb44e9d94eb.tar.gz
bcm5719-llvm-6b6dcc448ab4d297723c0173c7aa6fb44e9d94eb.zip
[utils] Add windows support to update_llc_test_checks.py
Strip dos line endings from llc generated files to allow the regex patterns to match them. Ensure updated *.ll files are generated with unix style line endings. llvm-svn: 258987
Diffstat (limited to 'llvm/utils/update_llc_test_checks.py')
-rwxr-xr-xllvm/utils/update_llc_test_checks.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/utils/update_llc_test_checks.py b/llvm/utils/update_llc_test_checks.py
index cfdf830907f..4ce034df308 100755
--- a/llvm/utils/update_llc_test_checks.py
+++ b/llvm/utils/update_llc_test_checks.py
@@ -20,6 +20,8 @@ def llc(args, cmd_args, ir):
with open(ir) as ir_file:
stdout = subprocess.check_output(args.llc_binary + ' ' + cmd_args,
shell=True, stdin=ir_file)
+ # Fix line endings to unix CR style.
+ stdout = stdout.replace('\r\n', '\n')
return stdout
@@ -211,7 +213,7 @@ def main():
if args.verbose:
print>>sys.stderr, 'Writing %d fixed lines to %s...' % (
len(fixed_lines), test)
- with open(test, 'w') as f:
+ with open(test, 'wb') as f:
f.writelines([l + '\n' for l in fixed_lines])
OpenPOWER on IntegriCloud