Split openFileForRead into Windows and Unix versions.

This has some advantages:

* Lets us use native, utf16 windows functions.
* Easy to produce good errors on windows about trying to use a
directory when we want a file.
* Simplifies the unix version a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186511 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Object/directory.ll b/test/Object/directory.ll
index 0d047b8..bf8ff32 100644
--- a/test/Object/directory.ll
+++ b/test/Object/directory.ll
@@ -3,8 +3,7 @@
 ;CHECK: .: Is a directory
 
 ; Opening a directory works on cygwin and freebsd.
-; On windows we just get a "Permission denied."
-;XFAIL: freebsd, win32, mingw32, cygwin
+;XFAIL: freebsd, cygwin
 
 ;RUN: rm -f %T/test.a
 ;RUN: touch %T/a-very-long-file-name