[AVR] Update the compiletest library to recognize AVR as a 16-bit target

This commit is contained in:
Dylan McKay 2020-03-05 13:18:51 +13:00
parent e369cf6b27
commit b4a041c050
2 changed files with 8 additions and 0 deletions

View file

@ -27,6 +27,12 @@ fn test_parse_normalization_string() {
let first = parse_normalization_string(&mut s);
assert_eq!(first, Some("something (32 bits)".to_owned()));
assert_eq!(s, " -> \"something ($WORD bits).");
// Nothing to normalize (No quotes, 16-bit)
let mut s = "normalize-stderr-16bit: something (16 bits) -> something ($WORD bits).";
let first = parse_normalization_string(&mut s);
assert_eq!(first, None);
assert_eq!(s, r#"normalize-stderr-16bit: something (16 bits) -> something ($WORD bits)."#);
}
fn config() -> Config {

View file

@ -115,6 +115,8 @@ pub fn matches_env(triple: &str, name: &str) -> bool {
pub fn get_pointer_width(triple: &str) -> &'static str {
if (triple.contains("64") && !triple.ends_with("gnux32")) || triple.starts_with("s390x") {
"64bit"
} else if triple.starts_with("avr") {
"16bit"
} else {
"32bit"
}