llvm.org GIT mirror llvm / 6af8781
llvm-ar: Let opening a directory failed in llvm-ar. Linux cannot open directories with open(2), although cygwin and *bsd can. Motivation: The test, Object/directory.ll, had been failing with --target=cygwin on Linux. XFAIL was improper for host issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194257 91177308-0d34-0410-b5e6-96231b3b80d8 NAKAMURA Takumi 6 years ago
2 changed file(s) with 7 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
0 ;RUN: rm -f %T/test.a
11 ;RUN: not llvm-ar r %T/test.a . 2>&1 | FileCheck %s
22 ;CHECK: .: Is a directory
3
4 ; Opening a directory works on cygwin and freebsd.
5 ;XFAIL: freebsd, cygwin
63
74 ;RUN: rm -f %T/test.a
85 ;RUN: touch %T/a-very-long-file-name
781781 sys::fs::file_status Status;
782782 failIfError(sys::fs::status(FD, Status), FileName);
783783
784 // Opening a directory doesn't make sense. Let it failed.
785 // Linux cannot open directories with open(2), although
786 // cygwin and *bsd can.
787 if (Status.type() == sys::fs::file_type::directory_file)
788 failIfError(error_code(errc::is_a_directory, posix_category()),
789 FileName);
790
784791 OwningPtr File;
785792 failIfError(MemoryBuffer::getOpenFile(FD, FileName, File,
786793 Status.getSize(), false),