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

Side by Side Diff: pydir/crosstest.py

Issue 554013002: Subzero: Move python scripts into a common pydir. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 3 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 | « llvm2iceinsts.py ('k') | pydir/llvm2iceinsts.py » ('j') | 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')
11 from utils import shellcmd 10 from utils import shellcmd
12 from utils import FindBaseNaCl 11 from utils import FindBaseNaCl
13 12
14 if __name__ == '__main__': 13 if __name__ == '__main__':
15 """Builds a cross-test binary that allows functions translated by 14 """Builds a cross-test binary that allows functions translated by
16 Subzero and llc to be compared. 15 Subzero and llc to be compared.
17 16
18 Each --test argument is compiled once by llc and once by Subzero. 17 Each --test argument is compiled once by llc and once by Subzero.
19 C/C++ tests are first compiled down to PNaCl bitcode by the 18 C/C++ tests are first compiled down to PNaCl bitcode by the
20 build-pnacl-ir.py script. The --prefix argument ensures that 19 build-pnacl-ir.py script. The --prefix argument ensures that
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 '-o=' + obj_llc, 130 '-o=' + obj_llc,
132 bitcode]) 131 bitcode])
133 objs.append(obj_llc) 132 objs.append(obj_llc)
134 else: 133 else:
135 objs.append(bitcode) 134 objs.append(bitcode)
136 135
137 linker = 'clang' if os.path.splitext(args.driver)[1] == '.c' else 'clang++' 136 linker = 'clang' if os.path.splitext(args.driver)[1] == '.c' else 'clang++'
138 shellcmd([linker, '-g', '-m32', args.driver] + 137 shellcmd([linker, '-g', '-m32', args.driver] +
139 objs + 138 objs +
140 ['-lm', '-lpthread', '-o', os.path.join(args.dir, args.output)]) 139 ['-lm', '-lpthread', '-o', os.path.join(args.dir, args.output)])
OLDNEW
« no previous file with comments | « llvm2iceinsts.py ('k') | pydir/llvm2iceinsts.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698