[BOLT] link_fdata support for hardcoded offsets in no-LBR
Allow using hardcoded offsets to blocks, eg:
```
// RUN: link_fdata --no-lbr ...
// FDATA: 1 foo 0 10
```
For LBR mode this was already supported. See for example:
- tail-duplication-complex.s
diff --git a/bolt/test/AArch64/fdata-nolbr.s b/bolt/test/AArch64/fdata-nolbr.s
index 5bb655f..5d7c0a4 100644
--- a/bolt/test/AArch64/fdata-nolbr.s
+++ b/bolt/test/AArch64/fdata-nolbr.s
@@ -5,7 +5,8 @@
# RUN: %clang %cflags -o %t %s
# RUN: %clang %s %cflags -Wl,-q -o %t
-# RUN: not link_fdata --no-lbr %s %t %t.fdata 2>&1 | FileCheck %s
+# RUN: link_fdata --no-lbr %s %t %t.fdata
+# RUN: cat %t.fdata | FileCheck %s
.text
.globl foo
@@ -14,5 +15,5 @@
# FDATA: 1 foo 0 10
ret
-# Currently does not work on non-lbr mode.
-# CHECK: AssertionError: ERROR: wrong format/whitespaces must be escaped
+# CHECK: no_lbr
+# CHECK-NEXT: 1 foo 0 10
diff --git a/bolt/test/link_fdata.py b/bolt/test/link_fdata.py
index 3837e39..613d582 100755
--- a/bolt/test/link_fdata.py
+++ b/bolt/test/link_fdata.py
@@ -58,7 +58,7 @@
fdata_match = fdata_pat.match(profile_line)
preagg_match = preagg_pat.match(profile_line)
nolbr_match = nolbr_pat.match(profile_line)
- if fdata_match:
+ if fdata_match and not (nolbr_match and args.no_lbr):
src_dst, execnt, mispred = fdata_match.groups()
# Split by whitespaces not preceded by a backslash (negative lookbehind)
chunks = re.split(r"(?<!\\) +", src_dst)