llvm.org GIT mirror llvm / ee64684
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 Duncan Sands 9 years ago
1 changed file(s) with 16 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
160160 C[1] = Triple::getVendorTypeName(Triple::VendorType(Vendor));
161161 for (int OS = 1+Triple::UnknownOS; OS <= Triple::Minix; ++OS) {
162162 C[2] = Triple::getOSTypeName(Triple::OSType(OS));
163
164 // If a value has multiple interpretations, then the permutation
165 // test will inevitably fail. Currently this is only the case for
166 // "psp" which parses as both an architecture and an O/S.
167 if (OS == Triple::Psp)
168 continue;
169
170 std::string E = Join(C[0], C[1], C[2]);
171 EXPECT_EQ(E, Triple::normalize(Join(C[0], C[1], C[2])));
172
173 EXPECT_EQ(E, Triple::normalize(Join(C[0], C[2], C[1])));
174 EXPECT_EQ(E, Triple::normalize(Join(C[1], C[2], C[0])));
175 EXPECT_EQ(E, Triple::normalize(Join(C[1], C[0], C[2])));
176 EXPECT_EQ(E, Triple::normalize(Join(C[2], C[0], C[1])));
177 EXPECT_EQ(E, Triple::normalize(Join(C[2], C[1], C[0])));
178
163179 for (int Env = 1+Triple::UnknownEnvironment; Env <= Triple::MachO;
164180 ++Env) {
165181 C[3] = Triple::getEnvironmentTypeName(Triple::EnvironmentType(Env));
166182
167 std::string E = Join(C[0], C[1], C[2]);
168183 std::string F = Join(C[0], C[1], C[2], C[3]);
169 EXPECT_EQ(E, Triple::normalize(Join(C[0], C[1], C[2])));
170184 EXPECT_EQ(F, Triple::normalize(Join(C[0], C[1], C[2], C[3])));
171
172 // If a value has multiple interpretations, then the permutation
173 // test will inevitably fail. Currently this is only the case for
174 // "psp" which parses as both an architecture and an O/S.
175 if (OS == Triple::Psp)
176 continue;
177
178 EXPECT_EQ(E, Triple::normalize(Join(C[0], C[2], C[1])));
179 EXPECT_EQ(E, Triple::normalize(Join(C[1], C[2], C[0])));
180 EXPECT_EQ(E, Triple::normalize(Join(C[1], C[0], C[2])));
181 EXPECT_EQ(E, Triple::normalize(Join(C[2], C[0], C[1])));
182 EXPECT_EQ(E, Triple::normalize(Join(C[2], C[1], C[0])));
183185
184186 EXPECT_EQ(F, Triple::normalize(Join(C[0], C[1], C[3], C[2])));
185187 EXPECT_EQ(F, Triple::normalize(Join(C[0], C[2], C[3], C[1])));