diff options
author | Duncan Sands <baldrick@free.fr> | 2011-02-03 08:14:04 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2011-02-03 08:14:04 +0000 |
commit | ee64684710486bf8a0cd156d0516e0a7caecfb0b (patch) | |
tree | 6e2858c67d34bc281cff8b4793d35e7b9813b104 /unittests | |
parent | ee0056d86616fda17a311b8280121fb79bd50843 (diff) | |
download | external_llvm-ee64684710486bf8a0cd156d0516e0a7caecfb0b.zip external_llvm-ee64684710486bf8a0cd156d0516e0a7caecfb0b.tar.gz external_llvm-ee64684710486bf8a0cd156d0516e0a7caecfb0b.tar.bz2 |
Part of this test is invariant inside the inner loop - move it outside
the loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124784 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/ADT/TripleTest.cpp | 30 |
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]))); |