[llvm] [yaml2obj] Don't use uninitialized Type (PR #123274)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 22 00:52:48 PST 2025
================
@@ -25,3 +25,31 @@ Sections:
Type: 0xabcd
- Name: decimal
Type: 1234
+
+
+# RUN: not yaml2obj %s --docnum=2 -o %t2 2>&1 | FileCheck %s --check-prefix=UNKNOWN-TYPE
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+Sections:
+ - Name: .foo
+ Type: FOO_SECTION
+
+# UNKNOWN-TYPE: error: invalid hex32 number
+
+
+# RUN: not yaml2obj %s --docnum=3 -o %t3 -DMACHINE=EM_NONE 2>&1 | FileCheck %s --check-prefix=UNKNOWN-SHT-TYPE
----------------
jh7370 wrote:
As the check pattern is identical for the two cases, you can reuse it. i.e. just change this `--check-prefix` argument to `--check-prefix=UNKNOWN-TYPE` and drop the `UNKNOWN-SHT-TYPE` check line below.
https://github.com/llvm/llvm-project/pull/123274
More information about the llvm-commits
mailing list