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

Side by Side Diff: crosstest/crosstest.py

Issue 362463002: Subzero: lower the rest of the atomic operations. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: rebase Created 6 years, 5 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 | crosstest/runtests.sh » ('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') 10 sys.path.insert(0, '../pydir')
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 metavar='EXECUTABLE', 50 metavar='EXECUTABLE',
51 help='Executable to produce') 51 help='Executable to produce')
52 argparser.add_argument('--dir', required=False, default='.', 52 argparser.add_argument('--dir', required=False, default='.',
53 metavar='OUTPUT_DIR', 53 metavar='OUTPUT_DIR',
54 help='Output directory for all files') 54 help='Output directory for all files')
55 argparser.add_argument('--llvm-bin-path', required=False, 55 argparser.add_argument('--llvm-bin-path', required=False,
56 default=os.environ.get('LLVM_BIN_PATH'), 56 default=os.environ.get('LLVM_BIN_PATH'),
57 metavar='PATH', 57 metavar='PATH',
58 help='Path to LLVM executables like llc ' + 58 help='Path to LLVM executables like llc ' +
59 '(defaults to $LLVM_BIN_PATH)') 59 '(defaults to $LLVM_BIN_PATH)')
60 argparser.add_argument('--crosstest-bitcode', required=False,
61 default=1, type=int,
62 help='Compile non-subzero crosstest object file ' +
63 'from the same bitcode as the subzero object. ' +
64 'If 0, then compile it straight from source.')
60 args = argparser.parse_args() 65 args = argparser.parse_args()
61 66
62 objs = [] 67 objs = []
63 remove_internal = re.compile('^define internal ') 68 remove_internal = re.compile('^define internal ')
64 fix_target = re.compile('le32-unknown-nacl') 69 fix_target = re.compile('le32-unknown-nacl')
65 llvm_bin_path = args.llvm_bin_path 70 llvm_bin_path = args.llvm_bin_path
66 for arg in args.test: 71 for arg in args.test:
67 base, ext = os.path.splitext(arg) 72 base, ext = os.path.splitext(arg)
68 if ext == '.ll': 73 if ext == '.ll':
69 bitcode = arg 74 bitcode = arg
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 # approaches can produce different semantics on some undefined 111 # approaches can produce different semantics on some undefined
107 # bitcode behavior. Specifically, LLVM produces different 112 # bitcode behavior. Specifically, LLVM produces different
108 # results for overflowing fptoui instructions for i32 and i64 113 # results for overflowing fptoui instructions for i32 and i64
109 # on x86-32. As it turns out, Subzero lowering was based on 114 # on x86-32. As it turns out, Subzero lowering was based on
110 # inspecting the object code produced by the direct llc 115 # inspecting the object code produced by the direct llc
111 # command, so we need to directly run llc on the bitcode, even 116 # command, so we need to directly run llc on the bitcode, even
112 # though it makes this script longer, to avoid spurious 117 # though it makes this script longer, to avoid spurious
113 # failures. This behavior can be inspected by switching 118 # failures. This behavior can be inspected by switching
114 # use_llc between True and False. 119 # use_llc between True and False.
115 use_llc = False 120 use_llc = False
116 if use_llc: 121 if not args.crosstest_bitcode:
122 objs.append(arg)
123 elif use_llc:
117 shellcmd([os.path.join(llvm_bin_path, 'llc'), 124 shellcmd([os.path.join(llvm_bin_path, 'llc'),
118 '-filetype=obj', 125 '-filetype=obj',
119 '-o=' + obj_llc, 126 '-o=' + obj_llc,
120 bitcode]) 127 bitcode])
121 objs.append(obj_llc) 128 objs.append(obj_llc)
122 else: 129 else:
123 objs.append(bitcode) 130 objs.append(bitcode)
124 131
125 linker = 'clang' if os.path.splitext(args.driver)[1] == '.c' else 'clang++' 132 linker = 'clang' if os.path.splitext(args.driver)[1] == '.c' else 'clang++'
126 shellcmd([os.path.join(llvm_bin_path, linker), '-g', '-m32', args.driver] + 133 shellcmd([os.path.join(llvm_bin_path, linker), '-g', '-m32', args.driver] +
127 objs + 134 objs +
128 ['-lm', '-o', os.path.join(args.dir, args.output)]) 135 ['-lm', '-lpthread', '-o', os.path.join(args.dir, args.output)])
OLDNEW
« no previous file with comments | « no previous file | crosstest/runtests.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698