Consume sanitizer blacklist as an extra hash file.

This commit is contained in:
Chris Manchester 2020-02-12 13:51:41 -08:00 коммит произвёл chmanchester
Родитель c70159839a
Коммит 9d13465563
1 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -107,6 +107,7 @@ counted_array!(pub static ARGS: [ArgInfo<gcc::ArgData>; _] = [
flag!("-fprofile-instr-generate", ProfileGenerate),
// Can be either -fprofile-instr-use or -fprofile-instr-use=path
take_arg!("-fprofile-instr-use", OsString, Concatenated, TooHard),
take_arg!("-fsanitize-blacklist", PathBuf, Concatenated('='), ExtraHashFile),
take_arg!("-gcc-toolchain", OsString, Separated, PassThrough),
take_arg!("-include-pch", PathBuf, CanBeSeparated, PreprocessorArgumentPath),
take_arg!("-load", PathBuf, Separated, ExtraHashFile),
@ -271,6 +272,19 @@ mod test {
assert_eq!(ovec!["plugin.so"], a.extra_hash_files);
}
#[test]
fn test_parse_fsanitize_blacklist() {
let a = parses!(
"-c",
"foo.c",
"-o",
"foo.o",
"-fsanitize-blacklist=list.txt"
);
assert_eq!(ovec!["-fsanitize-blacklist=list.txt"], a.common_args);
assert_eq!(ovec!["list.txt"], a.extra_hash_files);
}
#[test]
fn test_parse_color_diags() {
let a = parses!("-c", "foo.c", "-o", "foo.o", "-fcolor-diagnostics");