[llvm-commits] [llvm] r124784 - /llvm/trunk/unittests/ADT/TripleTest.cpp
Duncan Sands
baldrick at free.fr
Thu Feb 3 00:14:04 PST 2011
Author: baldrick
Date: Thu Feb 3 02:14:04 2011
New Revision: 124784
URL: http://llvm.org/viewvc/llvm-project?rev=124784&view=rev
Log:
Part of this test is invariant inside the inner loop - move it outside
the loop.
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=124784&r1=124783&r2=124784&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/TripleTest.cpp (original)
+++ llvm/trunk/unittests/ADT/TripleTest.cpp Thu Feb 3 02:14:04 2011
@@ -161,27 +161,29 @@
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])));
More information about the llvm-commits
mailing list