Revert commit 149912 (lattner) and add a testcase that shows the problem (which