diff options
| author | Dylan McKay <me@dylanmckay.io> | 2020-03-05 13:18:51 +1300 |
|---|---|---|
| committer | Dylan McKay <me@dylanmckay.io> | 2020-06-09 17:40:53 +1200 |
| commit | b4a041c0502f2880c875c3dd2155ccc3b98be301 (patch) | |
| tree | 9fb58ea213cfdab031c85d91a740b91cb623e084 /src | |
| parent | e369cf6b27257eef0c1e64d9e20b32abc98b784b (diff) | |
| download | rust-b4a041c0502f2880c875c3dd2155ccc3b98be301.tar.gz rust-b4a041c0502f2880c875c3dd2155ccc3b98be301.zip | |
[AVR] Update the compiletest library to recognize AVR as a 16-bit target
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/compiletest/src/header/tests.rs | 6 | ||||
| -rw-r--r-- | src/tools/compiletest/src/util.rs | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/header/tests.rs index 31d991e0c2f..f7355433463 100644 --- a/src/tools/compiletest/src/header/tests.rs +++ b/src/tools/compiletest/src/header/tests.rs @@ -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 { diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs index e1c3042edb8..ca36a15ffc7 100644 --- a/src/tools/compiletest/src/util.rs +++ b/src/tools/compiletest/src/util.rs @@ -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" } |
