@@ -9,18 +9,42 @@ default_test = make_action_command_line_test_rule()
99
1010asan_test = make_action_command_line_test_rule (
1111 config_settings = {
12+ "//command_line_option:compilation_mode" : "fastbuild" ,
13+ "//command_line_option:features" : ["asan" ],
14+ },
15+ )
16+
17+ asan_dbg_test = make_action_command_line_test_rule (
18+ config_settings = {
19+ "//command_line_option:compilation_mode" : "dbg" ,
1220 "//command_line_option:features" : ["asan" ],
1321 },
1422)
1523
1624tsan_test = make_action_command_line_test_rule (
1725 config_settings = {
26+ "//command_line_option:compilation_mode" : "fastbuild" ,
27+ "//command_line_option:features" : ["tsan" ],
28+ },
29+ )
30+
31+ tsan_dbg_test = make_action_command_line_test_rule (
32+ config_settings = {
33+ "//command_line_option:compilation_mode" : "dbg" ,
1834 "//command_line_option:features" : ["tsan" ],
1935 },
2036)
2137
2238ubsan_test = make_action_command_line_test_rule (
2339 config_settings = {
40+ "//command_line_option:compilation_mode" : "fastbuild" ,
41+ "//command_line_option:features" : ["ubsan" ],
42+ },
43+ )
44+
45+ ubsan_dbg_test = make_action_command_line_test_rule (
46+ config_settings = {
47+ "//command_line_option:compilation_mode" : "dbg" ,
2448 "//command_line_option:features" : ["ubsan" ],
2549 },
2650)
@@ -53,13 +77,35 @@ def sanitizer_test_suite(name):
5377 name = "{}_asan_cc_compile_test" .format (name ),
5478 tags = [name ],
5579 expected_argv = [
80+ "-fno-omit-frame-pointer" ,
5681 "-fsanitize=address" ,
5782 "-gline-tables-only" ,
83+ "-fno-sanitize-recover=all" ,
84+ ],
85+ not_expected_argv = [
86+ "-D_FORTIFY_SOURCE=1" ,
87+ "-g" ,
88+ "-g0" ,
89+ ],
90+ mnemonic = "CppCompile" ,
91+ target_under_test = "//test/test_data:cc_main" ,
92+ )
93+
94+ asan_dbg_test (
95+ name = "{}_asan_dbg_cc_compile_test" .format (name ),
96+ tags = [name ],
97+ expected_argv = [
5898 "-fno-omit-frame-pointer" ,
99+ "-O0" ,
100+ "-DDEBUG" ,
101+ "-g" ,
102+ "-fsanitize=address" ,
59103 "-fno-sanitize-recover=all" ,
60104 ],
61105 not_expected_argv = [
62106 "-D_FORTIFY_SOURCE=1" ,
107+ "-gline-tables-only" ,
108+ "-g0" ,
63109 ],
64110 mnemonic = "CppCompile" ,
65111 target_under_test = "//test/test_data:cc_main" ,
@@ -69,13 +115,15 @@ def sanitizer_test_suite(name):
69115 name = "{}_asan_objc_compile_test" .format (name ),
70116 tags = [name ],
71117 expected_argv = [
118+ "-fno-omit-frame-pointer" ,
72119 "-fsanitize=address" ,
73120 "-gline-tables-only" ,
74- "-fno-omit-frame-pointer" ,
75121 "-fno-sanitize-recover=all" ,
76122 ],
77123 not_expected_argv = [
78124 "-D_FORTIFY_SOURCE=1" ,
125+ "-g" ,
126+ "-g0" ,
79127 ],
80128 mnemonic = "ObjcCompile" ,
81129 target_under_test = "//test/test_data:objc_lib" ,
@@ -106,11 +154,35 @@ def sanitizer_test_suite(name):
106154 tags = [name ],
107155 expected_argv = [
108156 "-D_FORTIFY_SOURCE=1" ,
157+ "-fno-omit-frame-pointer" ,
109158 "-fsanitize=thread" ,
110159 "-gline-tables-only" ,
160+ "-fno-sanitize-recover=all" ,
161+ ],
162+ not_expected_argv = [
163+ "-g" ,
164+ "-g0" ,
165+ ],
166+ mnemonic = "CppCompile" ,
167+ target_under_test = "//test/test_data:cc_main" ,
168+ )
169+
170+ tsan_dbg_test (
171+ name = "{}_tsan_dbg_cc_compile_test" .format (name ),
172+ tags = [name ],
173+ expected_argv = [
174+ "-D_FORTIFY_SOURCE=1" ,
111175 "-fno-omit-frame-pointer" ,
176+ "-O0" ,
177+ "-DDEBUG" ,
178+ "-g" ,
179+ "-fsanitize=thread" ,
112180 "-fno-sanitize-recover=all" ,
113181 ],
182+ not_expected_argv = [
183+ "-gline-tables-only" ,
184+ "-g0" ,
185+ ],
114186 mnemonic = "CppCompile" ,
115187 target_under_test = "//test/test_data:cc_main" ,
116188 )
@@ -120,11 +192,15 @@ def sanitizer_test_suite(name):
120192 tags = [name ],
121193 expected_argv = [
122194 "-D_FORTIFY_SOURCE=1" ,
195+ "-fno-omit-frame-pointer" ,
123196 "-fsanitize=thread" ,
124197 "-gline-tables-only" ,
125- "-fno-omit-frame-pointer" ,
126198 "-fno-sanitize-recover=all" ,
127199 ],
200+ not_expected_argv = [
201+ "-g" ,
202+ "-g0" ,
203+ ],
128204 mnemonic = "ObjcCompile" ,
129205 target_under_test = "//test/test_data:objc_lib" ,
130206 )
@@ -154,11 +230,35 @@ def sanitizer_test_suite(name):
154230 tags = [name ],
155231 expected_argv = [
156232 "-D_FORTIFY_SOURCE=1" ,
233+ "-fno-omit-frame-pointer" ,
157234 "-fsanitize=undefined" ,
158235 "-gline-tables-only" ,
236+ "-fno-sanitize-recover=all" ,
237+ ],
238+ not_expected_argv = [
239+ "-g" ,
240+ "-g0" ,
241+ ],
242+ mnemonic = "CppCompile" ,
243+ target_under_test = "//test/test_data:cc_main" ,
244+ )
245+
246+ ubsan_dbg_test (
247+ name = "{}_ubsan_dbg_cc_compile_test" .format (name ),
248+ tags = [name ],
249+ expected_argv = [
250+ "-D_FORTIFY_SOURCE=1" ,
159251 "-fno-omit-frame-pointer" ,
252+ "-O0" ,
253+ "-DDEBUG" ,
254+ "-g" ,
255+ "-fsanitize=undefined" ,
160256 "-fno-sanitize-recover=all" ,
161257 ],
258+ not_expected_argv = [
259+ "-gline-tables-only" ,
260+ "-g0" ,
261+ ],
162262 mnemonic = "CppCompile" ,
163263 target_under_test = "//test/test_data:cc_main" ,
164264 )
@@ -168,11 +268,15 @@ def sanitizer_test_suite(name):
168268 tags = [name ],
169269 expected_argv = [
170270 "-D_FORTIFY_SOURCE=1" ,
271+ "-fno-omit-frame-pointer" ,
171272 "-fsanitize=undefined" ,
172273 "-gline-tables-only" ,
173- "-fno-omit-frame-pointer" ,
174274 "-fno-sanitize-recover=all" ,
175275 ],
276+ not_expected_argv = [
277+ "-g" ,
278+ "-g0" ,
279+ ],
176280 mnemonic = "ObjcCompile" ,
177281 target_under_test = "//test/test_data:objc_lib" ,
178282 )
0 commit comments