summaryrefslogtreecommitdiff
path: root/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
commit10fe174ef832b9d156683b5a187c50a0d4eecac0 (patch)
tree8d047116990574d8e4410d705fa049f1e19d1984 /utils/update_llc_test_checks.py
parent1db4cdc3b14f5eb989ef7768d087569a65a63a14 (diff)
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258987 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/update_llc_test_checks.py')
-rwxr-xr-xutils/update_llc_test_checks.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/utils/update_llc_test_checks.py b/utils/update_llc_test_checks.py
index cfdf830907f..4ce034df308 100755
--- a/utils/update_llc_test_checks.py
+++ b/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])