Skip to content

Commit b4a041c

Browse files
committed
[AVR] Update the compiletest library to recognize AVR as a 16-bit target
1 parent e369cf6 commit b4a041c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/tools/compiletest/src/header/tests.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ fn test_parse_normalization_string() {
2727
let first = parse_normalization_string(&mut s);
2828
assert_eq!(first, Some("something (32 bits)".to_owned()));
2929
assert_eq!(s, " -> \"something ($WORD bits).");
30+
31+
// Nothing to normalize (No quotes, 16-bit)
32+
let mut s = "normalize-stderr-16bit: something (16 bits) -> something ($WORD bits).";
33+
let first = parse_normalization_string(&mut s);
34+
assert_eq!(first, None);
35+
assert_eq!(s, r#"normalize-stderr-16bit: something (16 bits) -> something ($WORD bits)."#);
3036
}
3137

3238
fn config() -> Config {

src/tools/compiletest/src/util.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ pub fn matches_env(triple: &str, name: &str) -> bool {
115115
pub fn get_pointer_width(triple: &str) -> &'static str {
116116
if (triple.contains("64") && !triple.ends_with("gnux32")) || triple.starts_with("s390x") {
117117
"64bit"
118+
} else if triple.starts_with("avr") {
119+
"16bit"
118120
} else {
119121
"32bit"
120122
}

0 commit comments

Comments
 (0)