| OLD | NEW |
| 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 Loading... |
| 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)]) |
| OLD | NEW |