[llvm] r313160 - [mips] Add unitests to check parsing MIPS triples. NFC
Simon Atanasyan via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 13 10:36:16 PDT 2017
Author: atanasyan
Date: Wed Sep 13 10:36:16 2017
New Revision: 313160
URL: http://llvm.org/viewvc/llvm-project?rev=313160&view=rev
Log:
[mips] Add unitests to check parsing MIPS triples. NFC
Modified:
llvm/trunk/unittests/ADT/TripleTest.cpp
Modified: llvm/trunk/unittests/ADT/TripleTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/TripleTest.cpp?rev=313160&r1=313159&r2=313160&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/TripleTest.cpp (original)
+++ llvm/trunk/unittests/ADT/TripleTest.cpp Wed Sep 13 10:36:16 2017
@@ -308,6 +308,36 @@ TEST(TripleTest, ParsedIDs) {
EXPECT_EQ(Triple::Haiku, T.getOS());
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
+ T = Triple("mips-mti-linux-gnu");
+ EXPECT_EQ(Triple::mips, T.getArch());
+ EXPECT_EQ(Triple::MipsTechnologies, T.getVendor());
+ EXPECT_EQ(Triple::Linux, T.getOS());
+ EXPECT_EQ(Triple::GNU, T.getEnvironment());
+
+ T = Triple("mipsel-img-linux-gnu");
+ EXPECT_EQ(Triple::mipsel, T.getArch());
+ EXPECT_EQ(Triple::ImaginationTechnologies, T.getVendor());
+ EXPECT_EQ(Triple::Linux, T.getOS());
+ EXPECT_EQ(Triple::GNU, T.getEnvironment());
+
+ T = Triple("mips64-mti-linux-gnu");
+ EXPECT_EQ(Triple::mips64, T.getArch());
+ EXPECT_EQ(Triple::MipsTechnologies, T.getVendor());
+ EXPECT_EQ(Triple::Linux, T.getOS());
+ EXPECT_EQ(Triple::GNU, T.getEnvironment());
+
+ T = Triple("mips64el-img-linux-gnu");
+ EXPECT_EQ(Triple::mips64el, T.getArch());
+ EXPECT_EQ(Triple::ImaginationTechnologies, T.getVendor());
+ EXPECT_EQ(Triple::Linux, T.getOS());
+ EXPECT_EQ(Triple::GNU, T.getEnvironment());
+
+ T = Triple("mips64el-unknown-linux-gnuabi64");
+ EXPECT_EQ(Triple::mips64el, T.getArch());
+ EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
+ EXPECT_EQ(Triple::Linux, T.getOS());
+ EXPECT_EQ(Triple::GNUABI64, T.getEnvironment());
+
T = Triple("huh");
EXPECT_EQ(Triple::UnknownArch, T.getArch());
}
More information about the llvm-commits
mailing list