[llvm] [yaml2obj][COFF] Add BBAddrMap support to yaml2coff (PR #224504)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 23 01:27:18 PDT 2026
================
@@ -0,0 +1,321 @@
+## Check how yaml2obj produces .llvm_bb_addr_map sections.
+
+# RUN: yaml2obj --docnum=1 %s -o %t1 2>&1 | FileCheck %s --check-prefix=WARN
+# RUN: llvm-readobj --sections --section-data %t1 | FileCheck %s
+
+# WARN: warning: feature value(0) does not support multiple BB ranges.
+
+## Case 1: Specify SectionData.
+# CHECK: Number: 1
+# CHECK-NEXT: Name: .llvm_bb_addr_map
+# CHECK: RawDataSize: 0xD
----------------
jh7370 wrote:
If the expected entry has an invalid raw data size, but then it is matched later on, this will cause FileCheck to jump ahead to it without error. It'll likely then fail with a later check, but it'll be hard to debug. I'd recommend putting CHECK-NEXT lines in even for fields we don't care about. You can omit the values for fields that aren't relevant to the test. The alternative, if this becomes too verbose, is to use CHECK-SAME, so something like:
```
# CHECK: RawDataSize:
# CHECK-SAME: 0xD
```
Also, you probably want to include end of line regex markers after your values (e.g. `0xD{{$}}`) because your test would match a value of 0xD or 0xDEADBEEF for example. Alternatively, use --match-full-lines, but this doesn't work if using the CHECK-SAME approach and you'd need to match the irrelevant values in the other approach (which you could do using FileCheck's numeric substitution patterns, to avoid having to hard-code the values).
https://github.com/llvm/llvm-project/pull/224504
More information about the llvm-commits
mailing list