Skip to content

Commit b4b9fa5

Browse files
author
Pierre-vh
committed
[debuginfo-tests][dexter] Add --builder gcc support for POSIX
Differential Revision: https://reviews.llvm.org/D75339
1 parent d8ad7cc commit b4b9fa5

File tree

2 files changed

+25
-3
lines changed
  • debuginfo-tests/dexter/dex

2 files changed

+25
-3
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
if test -z "$PATHTOGCC"; then
5+
PATHTOGCC=gcc
6+
fi
7+
8+
for INDEX in $SOURCE_INDEXES
9+
do
10+
CFLAGS=$(eval echo "\$COMPILER_OPTIONS_$INDEX")
11+
SRCFILE=$(eval echo "\$SOURCE_FILE_$INDEX")
12+
OBJFILE=$(eval echo "\$OBJECT_FILE_$INDEX")
13+
$PATHTOGCC -std=gnu++11 -c $CFLAGS $SRCFILE -o $OBJFILE
14+
done
15+
16+
$PATHTOGCC $LINKER_OPTIONS $OBJECT_FILES -o $EXECUTABLE_FILE

debuginfo-tests/dexter/dex/tools/clang_opt_bisect/Tool.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ def _get_bisect_limits(self):
7777

7878
return limits
7979

80+
def handle_options(self, defaults):
81+
options = self.context.options
82+
if "clang" not in options.builder.lower():
83+
raise Error("--builder %s is not supported by the clang-opt-bisect tool - only 'clang' is "
84+
"supported " % options.builder)
85+
super(Tool, self).handle_options(defaults)
86+
8087
def _run_test(self, test_name): # noqa
8188
options = self.context.options
8289

@@ -177,7 +184,7 @@ def _run_test(self, test_name): # noqa
177184
file_name = ''.join(
178185
c for c in file_name
179186
if c.isalnum() or c in '()-_./ ').strip().replace(
180-
' ', '_').replace('/', '_')
187+
' ', '_').replace('/', '_')
181188

182189
output_text_path = os.path.join(options.results_directory,
183190
'{}.txt'.format(file_name))
@@ -188,7 +195,7 @@ def _run_test(self, test_name): # noqa
188195
heuristic_verbose_output + '\n', stream=Stream(fp))
189196

190197
output_dextIR_path = os.path.join(options.results_directory,
191-
'{}.dextIR'.format(file_name))
198+
'{}.dextIR'.format(file_name))
192199
with open(output_dextIR_path, 'wb') as fp:
193200
pickle.dump(steps, fp, protocol=pickle.HIGHEST_PROTOCOL)
194201

@@ -229,7 +236,6 @@ def _handle_results(self) -> ReturnCode:
229236
self._all_bisect_pass_summary)
230237
return ReturnCode.OK
231238

232-
233239
def _clang_opt_bisect_build(self, opt_bisect_limits):
234240
options = self.context.options
235241
compiler_options = [

0 commit comments

Comments
 (0)