llvm.org GIT mirror llvm / 153844c
[WebAssembly] COWS has been renamed to WASI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351297 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 1 year, 9 months ago
3 changed file(s) with 15 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
185185 AMDPAL, // AMD PAL Runtime
186186 HermitCore, // HermitCore Unikernel/Multikernel
187187 Hurd, // GNU/Hurd
188 COWS, // Capability-Oriented WebAssembly Syscalls
189 LastOSType = COWS
188 WASI, // Experimental WebAssembly OS
189 LastOSType = WASI
190190 };
191191 enum EnvironmentType {
192192 UnknownEnvironment,
587587 return getOS() == Triple::Hurd;
588588 }
589589
590 /// Tests whether the OS is COWS.
591 bool isOSCOWS() const {
592 return getOS() == Triple::COWS;
590 /// Tests whether the OS is WASI.
591 bool isOSWASI() const {
592 return getOS() == Triple::WASI;
593593 }
594594
595595 /// Tests whether the OS uses glibc.
207207 case AMDPAL: return "amdpal";
208208 case HermitCore: return "hermit";
209209 case Hurd: return "hurd";
210 case COWS: return "cows";
210 case WASI: return "wasi";
211211 }
212212
213213 llvm_unreachable("Invalid OSType");
505505 .StartsWith("amdpal", Triple::AMDPAL)
506506 .StartsWith("hermit", Triple::HermitCore)
507507 .StartsWith("hurd", Triple::Hurd)
508 .StartsWith("cows", Triple::COWS)
508 .StartsWith("wasi", Triple::WASI)
509509 .Default(Triple::UnknownOS);
510510 }
511511
252252 EXPECT_EQ(Triple::UnknownOS, T.getOS());
253253 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
254254
255 T = Triple("wasm32-unknown-cows-musl");
255 T = Triple("wasm32-unknown-wasi-musl");
256256 EXPECT_EQ(Triple::wasm32, T.getArch());
257257 EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
258 EXPECT_EQ(Triple::COWS, T.getOS());
258 EXPECT_EQ(Triple::WASI, T.getOS());
259259 EXPECT_EQ(Triple::Musl, T.getEnvironment());
260260
261261 T = Triple("wasm64-unknown-unknown");
264264 EXPECT_EQ(Triple::UnknownOS, T.getOS());
265265 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
266266
267 T = Triple("wasm64-unknown-cows-musl");
267 T = Triple("wasm64-unknown-wasi-musl");
268268 EXPECT_EQ(Triple::wasm64, T.getArch());
269269 EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
270 EXPECT_EQ(Triple::COWS, T.getOS());
270 EXPECT_EQ(Triple::WASI, T.getOS());
271271 EXPECT_EQ(Triple::Musl, T.getEnvironment());
272272
273273 T = Triple("avr-unknown-unknown");
12461246
12471247 EXPECT_EQ(Triple::Wasm, Triple("wasm32-unknown-unknown").getObjectFormat());
12481248 EXPECT_EQ(Triple::Wasm, Triple("wasm64-unknown-unknown").getObjectFormat());
1249 EXPECT_EQ(Triple::Wasm, Triple("wasm32-unknown-cows-musl").getObjectFormat());
1250 EXPECT_EQ(Triple::Wasm, Triple("wasm64-unknown-cows-musl").getObjectFormat());
1249 EXPECT_EQ(Triple::Wasm, Triple("wasm32-unknown-wasi-musl").getObjectFormat());
1250 EXPECT_EQ(Triple::Wasm, Triple("wasm64-unknown-wasi-musl").getObjectFormat());
12511251
12521252 EXPECT_EQ(Triple::Wasm,
12531253 Triple("wasm32-unknown-unknown-wasm").getObjectFormat());
12541254 EXPECT_EQ(Triple::Wasm,
12551255 Triple("wasm64-unknown-unknown-wasm").getObjectFormat());
12561256 EXPECT_EQ(Triple::Wasm,
1257 Triple("wasm32-unknown-cows-musl-wasm").getObjectFormat());
1257 Triple("wasm32-unknown-wasi-musl-wasm").getObjectFormat());
12581258 EXPECT_EQ(Triple::Wasm,
1259 Triple("wasm64-unknown-cows-musl-wasm").getObjectFormat());
1259 Triple("wasm64-unknown-wasi-musl-wasm").getObjectFormat());
12601260
12611261 Triple MSVCNormalized(Triple::normalize("i686-pc-windows-msvc-elf"));
12621262 EXPECT_EQ(Triple::ELF, MSVCNormalized.getObjectFormat());