diff options
author | Kevin Enderby <enderby@apple.com> | 2016-06-27 21:39:39 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2016-06-27 21:39:39 +0000 |
commit | 1051909df1a2dfc9e3b4b27d15b36b3019c21463 (patch) | |
tree | b7493e3ee6c0a1804ef7066f625fc0e99d20c416 /llvm/test | |
parent | f9e348bd59c441be9417507f9752c66716d2ab41 (diff) | |
download | bcm5719-llvm-1051909df1a2dfc9e3b4b27d15b36b3019c21463.tar.gz bcm5719-llvm-1051909df1a2dfc9e3b4b27d15b36b3019c21463.zip |
Change all but the last ErrorOr<...> use for MachOUniversalBinary to Expected<...> to
allow a good error message to be produced.
I added the one test case that the object file tools could produce an error
message. The other two errors can’t be triggered if the input file is passed
through sys::fs::identify_magic(). But the malformedError("bad magic number")
does get triggered by the logic in llvm-dsymutil when dealing with a normal
Mach-O file. The other "File too small ..." error would take a logic error
currently to produce and is not tested for.
llvm-svn: 273946
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/Object/Inputs/macho-invalid-fat | bin | 0 -> 8 bytes | |||
-rw-r--r-- | llvm/test/Object/macho-invalid.test | 3 |
2 files changed, 3 insertions, 0 deletions
diff --git a/llvm/test/Object/Inputs/macho-invalid-fat b/llvm/test/Object/Inputs/macho-invalid-fat Binary files differnew file mode 100644 index 00000000000..1fa01903c53 --- /dev/null +++ b/llvm/test/Object/Inputs/macho-invalid-fat diff --git a/llvm/test/Object/macho-invalid.test b/llvm/test/Object/macho-invalid.test index 3fe6296645b..4c66f5c402e 100644 --- a/llvm/test/Object/macho-invalid.test +++ b/llvm/test/Object/macho-invalid.test @@ -94,3 +94,6 @@ INCOMPLETE-SEGMENT-LOADC-FAT: macho-universal-bad2.x86_64.i386 (for architecture RUN: not llvm-objdump -macho -private-headers -arch all %p/Inputs/macho-universal-archive-bad2.x86_64.i386 2>&1 | FileCheck -check-prefix INCOMPLETE-SEGMENT-LOADC-FAT-ARCHIVE %s INCOMPLETE-SEGMENT-LOADC-FAT-ARCHIVE: macho-universal-archive-bad2.x86_64.i386(macho64-invalid-incomplete-segment-load-command) (for architecture x86_64) truncated or malformed object (load commands extend past the end of the file) + +RUN: not llvm-objdump -macho -universal-headers %p/Inputs/macho-invalid-fat 2>&1 | FileCheck -check-prefix INVALID-FAT %s +INVALID-FAT: truncated or malformed fat file (fat_arch_64 structs would extend past the end of the file) |