Contiki,
AMDPAL, // AMD PAL Runtime
HermitCore, // HermitCore Unikernel/Multikernel
- LastOSType = HermitCore
+ Hurd, // GNU/Hurd
+ LastOSType = Hurd
};
enum EnvironmentType {
UnknownEnvironment,
return getOS() == Triple::KFreeBSD;
}
+ /// Tests whether the OS is Hurd.
+ bool isOSHurd() const {
+ return getOS() == Triple::Hurd;
+ }
+
/// Tests whether the OS uses glibc.
bool isOSGlibc() const {
- return (getOS() == Triple::Linux || getOS() == Triple::KFreeBSD) &&
+ return (getOS() == Triple::Linux || getOS() == Triple::KFreeBSD ||
+ getOS() == Triple::Hurd) &&
!isAndroid();
}
case Contiki: return "contiki";
case AMDPAL: return "amdpal";
case HermitCore: return "hermit";
+ case Hurd: return "hurd";
}
llvm_unreachable("Invalid OSType");
.StartsWith("contiki", Triple::Contiki)
.StartsWith("amdpal", Triple::AMDPAL)
.StartsWith("hermit", Triple::HermitCore)
+ .StartsWith("hurd", Triple::Hurd)
.Default(Triple::UnknownOS);
}
EXPECT_EQ(Triple::Contiki, T.getOS());
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
+ T = Triple("i386-pc-hurd-gnu");
+ EXPECT_EQ(Triple::x86, T.getArch());
+ EXPECT_EQ(Triple::PC, T.getVendor());
+ EXPECT_EQ(Triple::Hurd, T.getOS());
+ EXPECT_EQ(Triple::GNU, T.getEnvironment());
+
T = Triple("x86_64-pc-linux-gnu");
EXPECT_EQ(Triple::x86_64, T.getArch());
EXPECT_EQ(Triple::PC, T.getVendor());