Skip to content

Commit

Permalink
Make compiletest do exact matching on triples
Browse files Browse the repository at this point in the history
This avoids the issues of the previous substring matching, ensuring
`ARCH_TABLE` and `OS_TABLE` will no longer contain redundant entries.
  • Loading branch information
varkor committed Mar 20, 2018
1 parent eae6d51 commit 61e1fbc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tools/compiletest/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,18 @@ pub fn matches_os(triple: &str, name: &str) -> bool {
if triple == "wasm32-unknown-unknown" {
return name == "emscripten" || name == "wasm32-bare"
}
let triple: Vec<_> = triple.split('-').collect();
for &(triple_os, os) in OS_TABLE {
if triple.contains(triple_os) {
if triple.contains(&triple_os) {
return os == name;
}
}
panic!("Cannot determine OS from triple");
}
pub fn get_arch(triple: &str) -> &'static str {
let triple: Vec<_> = triple.split('-').collect();
for &(triple_arch, arch) in ARCH_TABLE {
if triple.contains(triple_arch) {
if triple.contains(&triple_arch) {
return arch;
}
}
Expand Down

0 comments on commit 61e1fbc

Please sign in to comment.