llvm.org GIT mirror llvm / 290c772
Fix identify_magic() with mach-o stub dylibs. The wrong value was returned and the unittest did not cover the stub dylib case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217933 91177308-0d34-0410-b5e6-96231b3b80d8 Nick Kledzik 5 years ago
2 changed file(s) with 4 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
998998 case 6: return file_magic::macho_dynamically_linked_shared_lib;
999999 case 7: return file_magic::macho_dynamic_linker;
10001000 case 8: return file_magic::macho_bundle;
1001 case 9: return file_magic::macho_dynamic_linker;
1001 case 9: return file_magic::macho_dynamically_linked_shared_lib_stub;
10021002 case 10: return file_magic::macho_dsym_companion;
10031003 }
10041004 break;
500500 const char macho_bundle[] = "\xfe\xed\xfa\xce..........\x00\x08";
501501 const char macho_dsym_companion[] = "\xfe\xed\xfa\xce..........\x00\x0a";
502502 const char windows_resource[] = "\x00\x00\x00\x00\x020\x00\x00\x00\xff";
503 const char macho_dynamically_linked_shared_lib_stub[] =
504 "\xfe\xed\xfa\xce..........\x00\x09";
503505
504506 TEST_F(FileSystemTest, Magic) {
505507 struct type {
525527 DEFINE(macho_dynamically_linked_shared_lib),
526528 DEFINE(macho_dynamic_linker),
527529 DEFINE(macho_bundle),
530 DEFINE(macho_dynamically_linked_shared_lib_stub),
528531 DEFINE(macho_dsym_companion),
529532 DEFINE(windows_resource)
530533 #undef DEFINE