@@ -252,3 +252,33 @@ def test_remote_corpus_replacement_flags(self):
252
252
f"-fprofile-instr-use={ copied_profile_path } " in clang_command_lines [0 ])
253
253
self .assertTrue (
254
254
f"-fprofile-instr-use={ copied_profile_path } " in clang_command_lines [1 ])
255
+
256
+ def test_extra_bb_trace_flags (self ):
257
+ corpus_dir = self .create_tempdir ("corpus" )
258
+ corpus_modules = _setup_corpus (corpus_dir .full_path )
259
+ fake_clang_binary = self .create_tempfile ("fake_clang" )
260
+ fake_clang_invocations = self .create_tempfile ("fake_clang_invocations" )
261
+ _create_test_binary (fake_clang_binary .full_path ,
262
+ fake_clang_invocations .full_path )
263
+ fake_bb_trace_model_binary = self .create_tempfile (
264
+ "fake_basic_block_trace_model" )
265
+ fake_bb_trace_model_invocations = self .create_tempfile (
266
+ "fake_basic_block_trace_model_invocations" )
267
+ _create_test_binary (fake_bb_trace_model_binary .full_path ,
268
+ fake_bb_trace_model_invocations .full_path )
269
+
270
+ worker = regalloc_trace_worker .RegallocTraceWorker (
271
+ gin_config = "" ,
272
+ clang_path = fake_clang_binary .full_path ,
273
+ basic_block_trace_model_path = fake_bb_trace_model_binary .full_path ,
274
+ thread_count = 1 ,
275
+ corpus_path = corpus_dir .full_path ,
276
+ extra_bb_trace_model_flags = ["--extra_flag" ])
277
+ _ = worker .compile_corpus_and_evaluate (corpus_modules ,
278
+ "function_index_path.pb" ,
279
+ "bb_trace_path.pb" , None )
280
+
281
+ command_line = fake_bb_trace_model_invocations .read_text ().split (
282
+ "\n " )[0 ].split ()
283
+
284
+ self .assertTrue ("--extra_flag" in command_line )
0 commit comments