Simple. Do some monte carlo comparisons between a large number of generated functions, based on various heuristics like number of instructions. So quickly get rid of explicit mapping of tests, especially if used larger. Add some genetic algorithms and a little more AI stuff ;)
One interesting thing though with auto-generated code based on specific test code is that when the test fails at some point the process just has to be repeated, potentially being done automatically.