mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-19 02:42:58 +00:00
[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
This commit is contained in:
parent
1db4cdc3b1
commit
10fe174ef8
@ -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])
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user