[llvm-commits] Unit test for partial spec

Kenneth Uildriks kennethuil at gmail.com
Tue Jul 13 08:49:02 PDT 2010


This is my second attempt to set up a unit test to catch a recurrence
of the Partial Specialization bug where callsites were using the wrong
specialization.  Thus, the test needs to check that (a) a
specialization is done and (b) callsites are adjusted properly so the
wrong code isn't being called.

Also, I don't want the test to depend in any way on the names of the
specializations, since I want to create a naming scheme based on the
value(s) being specialized on; this will allow redundant equivalent
specializations to be removed at link time.  So the approach I'm using
is to have two test runs in the file differentiated by FileCheck
prefix.  One simply makes sure that PartialSpecialization transformed
the code when I expected it to.  The other applies inlining to the
result of the partial specialization and checks the inline result to
make sure that the callsites in the partial specialized version were
calling the right specialization.  If the callsites are wrong, the
inlining step will bring the wrong function bodies into the main
function and trigger the test failure.

Does this make sense?  Is there a better way to go about it?  Does
anyone see portability problems (the last attempt failed on one
particular buildbot running on a platform I don't have access to).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PartialSpecTest.patch
Type: application/octet-stream
Size: 1663 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100713/7e788120/attachment.obj>


More information about the llvm-commits mailing list