Partially revert r184225 test changes and make a smaller and more generic fix.

llvm-svn: 184232
2 files changed