Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Side by Side Diff: crosstest/crosstest.py

Issue 333713004: Subzero: give crosstest .sz intermediate files names that depend on flags (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: add target too Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python2 1 #!/usr/bin/env python2
2 2
3 import argparse 3 import argparse
4 import os 4 import os
5 import re 5 import re
6 import subprocess 6 import subprocess
7 import sys 7 import sys
8 import tempfile 8 import tempfile
9 9
10 sys.path.insert(0, '../pydir') 10 sys.path.insert(0, '../pydir')
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 f = open(bitcode) 75 f = open(bitcode)
76 ll_lines = f.readlines() 76 ll_lines = f.readlines()
77 f.close() 77 f.close()
78 f = open(bitcode, 'w') 78 f = open(bitcode, 'w')
79 for line in ll_lines: 79 for line in ll_lines:
80 line = remove_internal.sub('define ', line) 80 line = remove_internal.sub('define ', line)
81 line = fix_target.sub('i686-pc-linux-gnu', line) 81 line = fix_target.sub('i686-pc-linux-gnu', line)
82 f.write(line) 82 f.write(line)
83 f.close() 83 f.close()
84 84
85 asm_sz = os.path.join(args.dir, base + '.sz.s') 85 base_sz = '%s.O%s.%s' % (base, args.optlevel, args.target)
86 obj_sz = os.path.join(args.dir, base + '.sz.o') 86 asm_sz = os.path.join(args.dir, base_sz + '.sz.s')
87 obj_sz = os.path.join(args.dir, base_sz + '.sz.o')
87 obj_llc = os.path.join(args.dir, base + '.llc.o') 88 obj_llc = os.path.join(args.dir, base + '.llc.o')
88 shellcmd(['../llvm2ice', 89 shellcmd(['../llvm2ice',
89 '-O' + args.optlevel, 90 '-O' + args.optlevel,
90 '--target=' + args.target, 91 '--target=' + args.target,
91 '--prefix=' + args.prefix, 92 '--prefix=' + args.prefix,
92 '-o=' + asm_sz, 93 '-o=' + asm_sz,
93 bitcode]) 94 bitcode])
94 shellcmd([os.path.join(llvm_bin_path, 'llvm-mc'), 95 shellcmd([os.path.join(llvm_bin_path, 'llvm-mc'),
95 '-arch=' + arch_map[args.target], 96 '-arch=' + arch_map[args.target],
96 '-x86-asm-syntax=intel', 97 '-x86-asm-syntax=intel',
(...skipping 21 matching lines...) Expand all
118 '-o=' + obj_llc, 119 '-o=' + obj_llc,
119 bitcode]) 120 bitcode])
120 objs.append(obj_llc) 121 objs.append(obj_llc)
121 else: 122 else:
122 objs.append(bitcode) 123 objs.append(bitcode)
123 124
124 linker = 'clang' if os.path.splitext(args.driver)[1] == '.c' else 'clang++' 125 linker = 'clang' if os.path.splitext(args.driver)[1] == '.c' else 'clang++'
125 shellcmd([os.path.join(llvm_bin_path, linker), '-g', '-m32', args.driver] + 126 shellcmd([os.path.join(llvm_bin_path, linker), '-g', '-m32', args.driver] +
126 objs + 127 objs +
127 ['-lm', '-o', os.path.join(args.dir, args.output)]) 128 ['-lm', '-o', os.path.join(args.dir, args.output)])
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698