]> git.proxmox.com Git - rustc.git/blobdiff - vendor/compiletest_rs/src/util.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / vendor / compiletest_rs / src / util.rs
index fed8f7a522d6d9b6c034cc25dde5d3a80e8941fa..1290fe24e1b97e5e28a9dc73a2ca84ef61a0867d 100644 (file)
@@ -41,6 +41,7 @@ const ARCH_TABLE: &'static [(&'static str, &'static str)] = &[
     ("i386", "x86"),
     ("i586", "x86"),
     ("i686", "x86"),
+    ("loongarch64", "loongarch64"),
     ("mips", "mips"),
     ("msp430", "msp430"),
     ("nvptx64", "nvptx64"),
@@ -65,15 +66,15 @@ pub fn matches_os(triple: &str, name: &str) -> bool {
             return os == name;
         }
     }
-    panic!("Cannot determine OS from triple");
+    false
 }
-pub fn get_arch(triple: &str) -> &'static str {
+pub fn get_arch(triple: &str) -> &str {
     for &(triple_arch, arch) in ARCH_TABLE {
         if triple.contains(triple_arch) {
             return arch;
         }
     }
-    panic!("Cannot determine Architecture from triple");
+    triple.split('-').nth(0).unwrap()
 }
 
 pub fn get_env(triple: &str) -> Option<&str> {