[llvm] [SystemZ][z/OS] yaml2obj for header and end records (PR #73859)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 02:27:21 PST 2023


================
@@ -0,0 +1,5 @@
+# RUN: not yaml2obj %s FileCheck --ignore-case %s --check-prefix=ERR
+
+#ERR: yaml2obj: error: unknown document type
----------------
jh7370 wrote:

Nit: space after `#` please.

This isn't the message I'd expected to see: I expected to see something about "missing required key", but it appears that yaml2obj treats just `--- <tag>` as a document of unknown type (which is clearly not the case, since it clearly has a defined type via the `<tag>`). This sounds like a pre-existing bug in yaml2obj (I tested it and the same situation happens with e.g. `!ELF`). To workaround it in the test, you could add a single field in the header, e.g:
```
--- !GOFF
X: []
```
For ELF, this resulted in the expected "missing header" error (as well as a separate error about an unknown field). You should check for the "missing header" error message only, and probably add a comment saying the extra field is to workaround the aforementioned issue.

https://github.com/llvm/llvm-project/pull/73859


More information about the llvm-commits mailing list