[PATCH] D23156: [ADT] Stop trying to test every combination of values in a triple in every permutation.
Renato Golin via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 5 06:51:53 PDT 2016
rengolin added a comment.
I'm still looking at the code and the comments, but wouldn't it be enough for 99% of the cases to test it against "unknown" on all other fields? I mean, there are a few problematic combinations, but they require specialised knowledge, and the old test (nor the new one) are checking them.
So, I'd expect something like:
for (Arch) {
E = join (Arch, "unknown", "unknown", "unknown");
do {
EXPECT_EQ(E, Triple::normalize(Join(C[I[0]], C[I[1]], C[I[2]])));
} while (std::next_permutation(std::begin(I), std::end(I)));
}
for (Vendor) {
E = join ("unknown", Vendor, "unknown", "unknown");
...
to catch most silly errors. If none of those are caught, than we move into more advanced testing, via specialised knowledge, which we already do below, ex:
EXPECT_EQ("i386--windows-gnu", Triple::normalize("i386-mingw32"));
But maybe also some classes of problems, which would require some more permutation analysis, but only a fraction of the original problem.
https://reviews.llvm.org/D23156
More information about the llvm-commits
mailing list