This adds a file name to the error message, adds a missing test case and refactors code a bit. llvm-svn: 336651