[llvm] [llvm-ifs] Treat unknown symbol types as error. (PR #75872)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 20 01:02:21 PST 2023
================
@@ -56,6 +56,21 @@ TEST(ElfYamlTextAPI, YAMLReadableTBE) {
EXPECT_STREQ(Stub->NeededLibs[2].c_str(), "libbar.so");
}
+TEST(ElfYamlTextAPI, YAMLReadsInvalidSymbols) {
+ const char Data[] =
+ "--- !ifs-v1\n"
+ "IfsVersion: 1.0\n"
+ "SoName: test.so\n"
+ "Target: { ObjectFormat: ELF, Arch: x86_64, Endianness: little, "
+ "BitWidth: 64 }\n"
+ "Symbols:\n"
+ " - { Name: not, Type: File, Undefined: true, Size: 111, "
+ "Weak: true, Warning: \'All fields populated!\' }\n"
+ "...\n";
+ Expected<std::unique_ptr<IFSStub>> StubOrErr = readIFSFromBuffer(Data);
+ ASSERT_THAT_ERROR(StubOrErr.takeError(), Failed());
----------------
jh7370 wrote:
Could you use `FailedWithMessage` and check the error is the one you expect?
https://github.com/llvm/llvm-project/pull/75872
More information about the llvm-commits
mailing list