[llvm] [GOFF] Refactor writing GOFF records (PR #93855)

Neumann Hon via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 23:27:32 PDT 2024


================
@@ -0,0 +1,74 @@
+# RUN: awk 'BEGIN {str = sprintf("%47s", "")} {gsub("@FILL@", str); print}' < %s | \
+# RUN:   yaml2obj | od -v -An -tx1 | \
+# RUN:   FileCheck --ignore-case --check-prefix CHECK1 %s
+# RUN: awk 'BEGIN {str = sprintf("%48s", "")} {gsub("@FILL@", str); print}' < %s | \
+# RUN:   yaml2obj | od -v -An -tx1 | \
+# RUN:   FileCheck --ignore-case --check-prefix CHECK2 %s
+# RUN: awk 'BEGIN {str = sprintf("%125s", "")} {gsub("@FILL@", str); print}' < %s | \
+# RUN:   yaml2obj | od -v -An -tx1 | \
+# RUN:   FileCheck --ignore-case --check-prefix CHECK3 %s
+# RUN: awk 'BEGIN {str = sprintf("%160s", "")} {gsub("@FILL@", str); print}' < %s | \
+# RUN:   yaml2obj | od -v -An -tx1 | \
+# RUN:   FileCheck --ignore-case --check-prefix CHECK4 %s
+
+
+## Verify that the entry name is written correctly over multiple records.
+## The continued/continuation flags are in the lower nibble of the 2nd byte
+## of a record.
+
+## Last byte is a fill byte.
+# CHECK1:      03 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+# CHECK1-NEXT: 00 00 00 00 00 00 00 00 00 00 c6 96 96 c2 81 99
+# CHECK1-NEXT: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
+# CHECK1-NEXT: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
+# CHECK1-NEXT: 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00
+# CHECK1-EMPTY:
+
+## 1 record fully used.
+## Flags = 0 => no continuation, not continued.
----------------
Everybody0523 wrote:

```suggestion
## Flags = 0 => not a continuation, not continued.
```
Maybe it's just me but when I read "no continuation" I'm not sure whether it means the record in question has no continuation or that the record itself is not a continuation.

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


More information about the llvm-commits mailing list