aboutsummaryrefslogtreecommitdiffstats
path: root/unittests/ADT/TripleTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/ADT/TripleTest.cpp')
-rw-r--r--unittests/ADT/TripleTest.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/unittests/ADT/TripleTest.cpp b/unittests/ADT/TripleTest.cpp
index b57f6ba..160b692 100644
--- a/unittests/ADT/TripleTest.cpp
+++ b/unittests/ADT/TripleTest.cpp
@@ -161,27 +161,29 @@ TEST(TripleTest, Normalization) {
C[1] = Triple::getVendorTypeName(Triple::VendorType(Vendor));
for (int OS = 1+Triple::UnknownOS; OS <= Triple::Minix; ++OS) {
C[2] = Triple::getOSTypeName(Triple::OSType(OS));
+
+ // If a value has multiple interpretations, then the permutation
+ // test will inevitably fail. Currently this is only the case for
+ // "psp" which parses as both an architecture and an O/S.
+ if (OS == Triple::Psp)
+ continue;
+
+ std::string E = Join(C[0], C[1], C[2]);
+ EXPECT_EQ(E, Triple::normalize(Join(C[0], C[1], C[2])));
+
+ EXPECT_EQ(E, Triple::normalize(Join(C[0], C[2], C[1])));
+ EXPECT_EQ(E, Triple::normalize(Join(C[1], C[2], C[0])));
+ EXPECT_EQ(E, Triple::normalize(Join(C[1], C[0], C[2])));
+ EXPECT_EQ(E, Triple::normalize(Join(C[2], C[0], C[1])));
+ EXPECT_EQ(E, Triple::normalize(Join(C[2], C[1], C[0])));
+
for (int Env = 1+Triple::UnknownEnvironment; Env <= Triple::MachO;
++Env) {
C[3] = Triple::getEnvironmentTypeName(Triple::EnvironmentType(Env));
- std::string E = Join(C[0], C[1], C[2]);
std::string F = Join(C[0], C[1], C[2], C[3]);
- EXPECT_EQ(E, Triple::normalize(Join(C[0], C[1], C[2])));
EXPECT_EQ(F, Triple::normalize(Join(C[0], C[1], C[2], C[3])));
- // If a value has multiple interpretations, then the permutation
- // test will inevitably fail. Currently this is only the case for
- // "psp" which parses as both an architecture and an O/S.
- if (OS == Triple::Psp)
- continue;
-
- EXPECT_EQ(E, Triple::normalize(Join(C[0], C[2], C[1])));
- EXPECT_EQ(E, Triple::normalize(Join(C[1], C[2], C[0])));
- EXPECT_EQ(E, Triple::normalize(Join(C[1], C[0], C[2])));
- EXPECT_EQ(E, Triple::normalize(Join(C[2], C[0], C[1])));
- EXPECT_EQ(E, Triple::normalize(Join(C[2], C[1], C[0])));
-
EXPECT_EQ(F, Triple::normalize(Join(C[0], C[1], C[3], C[2])));
EXPECT_EQ(F, Triple::normalize(Join(C[0], C[2], C[3], C[1])));
EXPECT_EQ(F, Triple::normalize(Join(C[0], C[2], C[1], C[3])));