Skip to content

Commit e7f960a

Browse files
committed
add ubsan to Debug test Profile
1 parent 0975248 commit e7f960a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/lang_tests_common.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,19 @@ pub fn main_inner(profile: Profile) {
115115
}
116116
}
117117
match profile {
118-
Profile::Debug => {}
118+
Profile::Debug => {
119+
if test_target.is_ok() {
120+
// m68k doesn't have lubsan for now
121+
compiler.args(["-C", "llvm-args=sanitize-undefined"]);
122+
} else {
123+
compiler.args([
124+
"-C",
125+
"llvm-args=sanitize-undefined",
126+
"-C",
127+
"link-args=-lubsan",
128+
]);
129+
}
130+
}
119131
Profile::Release => {
120132
compiler.args(["-C", "opt-level=3", "-C", "lto=no"]);
121133
}

0 commit comments

Comments
 (0)