[Driver][test] Fix ClangDriverTest
authorFangrui Song <i@maskray.me>
Fri, 5 Mar 2021 06:44:37 +0000 (22:44 -0800)
committerFangrui Song <i@maskray.me>
Fri, 5 Mar 2021 06:44:37 +0000 (22:44 -0800)
clang/lib/Driver/Distro.cpp
clang/unittests/Driver/DistroTest.cpp

index 785394e..9fc790f 100644 (file)
@@ -36,10 +36,10 @@ static Distro::DistroType DetectOsRelease(llvm::vfs::FileSystem &VFS) {
   for (StringRef Line : Lines)
     if (Version == Distro::UnknownDistro && Line.startswith("ID="))
       Version = llvm::StringSwitch<Distro::DistroType>(Line.substr(3))
+                    .Case("alpine", Distro::AlpineLinux)
                     .Case("fedora", Distro::Fedora)
                     .Case("gentoo", Distro::Gentoo)
                     .Case("arch", Distro::ArchLinux)
-                    .Case("exherbo", Distro::Exherbo)
                     // On SLES, /etc/os-release was introduced in SLES 11.
                     .Case("sles", Distro::OpenSUSE)
                     .Case("opensuse", Distro::OpenSUSE)
index 7c00a8f..b6e4ca9 100644 (file)
@@ -275,12 +275,10 @@ TEST(DistroTest, DetectDebian) {
 
 TEST(DistroTest, DetectExherbo) {
   llvm::vfs::InMemoryFileSystem ExherboFileSystem;
-  ExherboFileSystem.addFile("/etc/exherbo-release", 0, // (ASCII art)
-                                 llvm::MemoryBuffer::getMemBuffer(""));
   ExherboFileSystem.addFile("/etc/os-release", 0,
       llvm::MemoryBuffer::getMemBuffer("NAME=\"Exherbo\"\n"
                                        "PRETTY_NAME=\"Exherbo Linux\"\n"
-                                       "ID=\"exherbo\"\n"
+                                       "ID=exherbo\n"
                                        "ANSI_COLOR=\"0;32\"\n"
                                        "HOME_URL=\"https://www.exherbo.org/\"\n"
                                        "SUPPORT_URL=\"irc://irc.freenode.net/#exherbo\"\n"