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
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
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])