This adds all missing format values that are defined in
ELFObjectFile<ELFT>::getFileFormatName().
Details
Diff Detail
Event Timeline
llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test contains some tests as well, e.g. sparc. Should we remove some redundant targets there?
llvm/unittests/Object/ELFObjectFileTest.cpp | ||
---|---|---|
77–83 | Maybe it's worth showing that an unused machine value also produces this result? Seems like an easy mistake would be to handle all the known machine types (including EM_NONE) and then put an llvm_unreachable or something at the end which is caught if an undefined value is used. | |
86–87 | Optional, but it might be worth having versions that test the unknown paths for situations like this where one of the classes is unsupported and therefore you get something like "elf32-unknown". |
llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test tests -O (--output-format) option of llvm-objcopy.
I probably do not see why any of those tests are really redundant. I think it is not the same as D86350 for llvm-readobj, where we are really able to test
just a few values printed for "Format" field, because it is directly related with the getFileFormatName result, which is tested here.
Maybe it's worth showing that an unused machine value also produces this result? Seems like an easy mistake would be to handle all the known machine types (including EM_NONE) and then put an llvm_unreachable or something at the end which is caught if an undefined value is used.