AMDPAL, // AMD PAL Runtime
HermitCore, // HermitCore Unikernel/Multikernel
Hurd, // GNU/Hurd
- LastOSType = Hurd
+ COWS, // Capability-Oriented WebAssembly Syscalls
+ LastOSType = COWS
};
enum EnvironmentType {
UnknownEnvironment,
return getOS() == Triple::Hurd;
}
+ /// Tests whether the OS is COWS.
+ bool isOSCOWS() const {
+ return getOS() == Triple::COWS;
+ }
+
/// Tests whether the OS uses glibc.
bool isOSGlibc() const {
return (getOS() == Triple::Linux || getOS() == Triple::KFreeBSD ||
case AMDPAL: return "amdpal";
case HermitCore: return "hermit";
case Hurd: return "hurd";
+ case COWS: return "cows";
}
llvm_unreachable("Invalid OSType");
.StartsWith("amdpal", Triple::AMDPAL)
.StartsWith("hermit", Triple::HermitCore)
.StartsWith("hurd", Triple::Hurd)
+ .StartsWith("cows", Triple::COWS)
.Default(Triple::UnknownOS);
}
EXPECT_EQ(Triple::UnknownOS, T.getOS());
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
+ T = Triple("wasm32-unknown-cows-musl");
+ EXPECT_EQ(Triple::wasm32, T.getArch());
+ EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
+ EXPECT_EQ(Triple::COWS, T.getOS());
+ EXPECT_EQ(Triple::Musl, T.getEnvironment());
+
T = Triple("wasm64-unknown-unknown");
EXPECT_EQ(Triple::wasm64, T.getArch());
EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
EXPECT_EQ(Triple::UnknownOS, T.getOS());
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
+ T = Triple("wasm64-unknown-cows-musl");
+ EXPECT_EQ(Triple::wasm64, T.getArch());
+ EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
+ EXPECT_EQ(Triple::COWS, T.getOS());
+ EXPECT_EQ(Triple::Musl, T.getEnvironment());
+
T = Triple("avr-unknown-unknown");
EXPECT_EQ(Triple::avr, T.getArch());
EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
EXPECT_EQ(Triple::Wasm, Triple("wasm32-unknown-unknown").getObjectFormat());
EXPECT_EQ(Triple::Wasm, Triple("wasm64-unknown-unknown").getObjectFormat());
+ EXPECT_EQ(Triple::Wasm, Triple("wasm32-unknown-cows-musl").getObjectFormat());
+ EXPECT_EQ(Triple::Wasm, Triple("wasm64-unknown-cows-musl").getObjectFormat());
EXPECT_EQ(Triple::Wasm,
Triple("wasm32-unknown-unknown-wasm").getObjectFormat());
EXPECT_EQ(Triple::Wasm,
Triple("wasm64-unknown-unknown-wasm").getObjectFormat());
+ EXPECT_EQ(Triple::Wasm,
+ Triple("wasm32-unknown-cows-musl-wasm").getObjectFormat());
+ EXPECT_EQ(Triple::Wasm,
+ Triple("wasm64-unknown-cows-musl-wasm").getObjectFormat());
Triple MSVCNormalized(Triple::normalize("i686-pc-windows-msvc-elf"));
EXPECT_EQ(Triple::ELF, MSVCNormalized.getObjectFormat());