llvm.org GIT mirror llvm / 15f67f9
[WebAssembly] Test the "wasm32-wasi" triple Add triple tests for "wasm32-wasi" and "wasm64-wasi", and also remove the "-musl" component from the existing wasm triple tests as we're not using that in practice (WASI libc is derived in part from musl, but it is not fully musl-compatible). Differential Revision: https://reviews.llvm.org/D61334 Reviewer: sbc100 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359629 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 3 months ago
1 changed file(s) with 18 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
251251 EXPECT_EQ(Triple::UnknownOS, T.getOS());
252252 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
253253
254 T = Triple("wasm32-unknown-wasi-musl");
254 T = Triple("wasm32-unknown-wasi");
255255 EXPECT_EQ(Triple::wasm32, T.getArch());
256256 EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
257257 EXPECT_EQ(Triple::WASI, T.getOS());
258 EXPECT_EQ(Triple::Musl, T.getEnvironment());
258 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
259259
260260 T = Triple("wasm64-unknown-unknown");
261261 EXPECT_EQ(Triple::wasm64, T.getArch());
263263 EXPECT_EQ(Triple::UnknownOS, T.getOS());
264264 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
265265
266 T = Triple("wasm64-unknown-wasi-musl");
266 T = Triple("wasm64-unknown-wasi");
267267 EXPECT_EQ(Triple::wasm64, T.getArch());
268268 EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
269269 EXPECT_EQ(Triple::WASI, T.getOS());
270 EXPECT_EQ(Triple::Musl, T.getEnvironment());
270 EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
271271
272272 T = Triple("avr-unknown-unknown");
273273 EXPECT_EQ(Triple::avr, T.getArch());
701701 Triple::normalize("i686-linux")); // i686-pc-linux-gnu
702702 EXPECT_EQ("arm-none-unknown-eabi",
703703 Triple::normalize("arm-none-eabi")); // arm-none-eabi
704 EXPECT_EQ("wasm32-unknown-wasi",
705 Triple::normalize("wasm32-wasi")); // wasm32-unknown-wasi
706 EXPECT_EQ("wasm64-unknown-wasi",
707 Triple::normalize("wasm64-wasi")); // wasm64-unknown-wasi
704708 }
705709
706710 TEST(TripleTest, MutateName) {
12451249
12461250 EXPECT_EQ(Triple::Wasm, Triple("wasm32-unknown-unknown").getObjectFormat());
12471251 EXPECT_EQ(Triple::Wasm, Triple("wasm64-unknown-unknown").getObjectFormat());
1248 EXPECT_EQ(Triple::Wasm, Triple("wasm32-unknown-wasi-musl").getObjectFormat());
1249 EXPECT_EQ(Triple::Wasm, Triple("wasm64-unknown-wasi-musl").getObjectFormat());
1252 EXPECT_EQ(Triple::Wasm, Triple("wasm32-wasi").getObjectFormat());
1253 EXPECT_EQ(Triple::Wasm, Triple("wasm64-wasi").getObjectFormat());
1254 EXPECT_EQ(Triple::Wasm, Triple("wasm32-unknown-wasi").getObjectFormat());
1255 EXPECT_EQ(Triple::Wasm, Triple("wasm64-unknown-wasi").getObjectFormat());
12501256
12511257 EXPECT_EQ(Triple::Wasm,
12521258 Triple("wasm32-unknown-unknown-wasm").getObjectFormat());
12531259 EXPECT_EQ(Triple::Wasm,
12541260 Triple("wasm64-unknown-unknown-wasm").getObjectFormat());
12551261 EXPECT_EQ(Triple::Wasm,
1256 Triple("wasm32-unknown-wasi-musl-wasm").getObjectFormat());
1262 Triple("wasm32-wasi-wasm").getObjectFormat());
12571263 EXPECT_EQ(Triple::Wasm,
1258 Triple("wasm64-unknown-wasi-musl-wasm").getObjectFormat());
1264 Triple("wasm64-wasi-wasm").getObjectFormat());
1265 EXPECT_EQ(Triple::Wasm,
1266 Triple("wasm32-unknown-wasi-wasm").getObjectFormat());
1267 EXPECT_EQ(Triple::Wasm,
1268 Triple("wasm64-unknown-wasi-wasm").getObjectFormat());
12591269
12601270 EXPECT_EQ(Triple::XCOFF, Triple("powerpc-ibm-aix").getObjectFormat());
12611271 EXPECT_EQ(Triple::XCOFF, Triple("powerpc64-ibm-aix").getObjectFormat());