r206504, thanks! We might indeed consider to refactor the code when we have better test coverage and better understanding of the corner cases. I'll consider simplifying the tests in a separate commit. http://reviews.llvm.org/D3410