summaryrefslogtreecommitdiffstats
path: root/unittests
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2013-11-14 22:09:08 +0000
committerRui Ueyama <ruiu@google.com>2013-11-14 22:09:08 +0000
commitb850a05f2c914fef74dbafbf61470512a976c632 (patch)
tree182add9a77e395b70dc4faedcccbac6f4f581a9b /unittests
parent6a1a5e94e2b094aead41f171ee060d91ad25777c (diff)
downloadexternal_llvm-b850a05f2c914fef74dbafbf61470512a976c632.zip
external_llvm-b850a05f2c914fef74dbafbf61470512a976c632.tar.gz
external_llvm-b850a05f2c914fef74dbafbf61470512a976c632.tar.bz2
Recognize 0x0000 as a COFF file magic.
Summary: Some machine-type-neutral object files containing only undefined symbols actually do exist in the Windows standard library. Need to recognize them as COFF files. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2164 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194734 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Support/Path.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/unittests/Support/Path.cpp b/unittests/Support/Path.cpp
index caf17b9..2323029 100644
--- a/unittests/Support/Path.cpp
+++ b/unittests/Support/Path.cpp
@@ -418,6 +418,7 @@ TEST_F(FileSystemTest, DirectoryIteration) {
const char archive[] = "!<arch>\x0A";
const char bitcode[] = "\xde\xc0\x17\x0b";
+const char coff_object[] = "\x00\x00......";
const char elf_relocatable[] = { 0x7f, 'E', 'L', 'F', 1, 2, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1 };
const char macho_universal_binary[] = "\xca\xfe\xba\xbe...\0x00";
@@ -445,6 +446,7 @@ TEST_F(FileSystemTest, Magic) {
{ #magic, magic, sizeof(magic), fs::file_magic::magic }
DEFINE(archive),
DEFINE(bitcode),
+ DEFINE(coff_object),
DEFINE(elf_relocatable),
DEFINE(macho_universal_binary),
DEFINE(macho_object),