[llvm] [SHT_LLVM_BB_ADDR_MAP] Adds pretty printing of BFI and BPI for PGO Analysis Map in tools. (PR #82292)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 21 23:56:55 PST 2024


================
@@ -3,12 +3,14 @@
 
 ## Check 64-bit:
 # RUN: yaml2obj %s -DBITS=64 -DADDR=0x999999999 -o %t1.x64.o
-# RUN: llvm-readobj %t1.x64.o --bb-addr-map 2>&1 | FileCheck %s -DADDR=0x999999999 -DFILE=%t1.x64.o --check-prefix=CHECK
+# RUN: llvm-readobj %t1.x64.o --bb-addr-map 2>&1 | FileCheck %s -DADDR=0x999999999 -DFILE=%t1.x64.o --check-prefixes=CHECK,RAW
+# RUN: llvm-readobj %t1.x64.o --bb-addr-map --pretty-pgo-analysis-map 2>&1 | FileCheck %s -DADDR=0x999999999 -DFILE=%t1.x64.o --check-prefixes=CHECK,PRETTY
----------------
jh7370 wrote:

> The braces and bracket are good enough to validate the fields are printed in the right spot and then trust the spacing is accurate from ScopedPrinters tests.

In this context, I'm actually more interested in checking that there isn't anything on the line that is unexpected (e.g. garbage data etc). `--match-full-lines` on its own would probably suffice in this case.

> There is a warning that we test for which throws off a full line match since it contains the readobj absolute path which varies by host test machine.

FWIW, this is easily dealt with by adding `{{.*}}` to the start of the check for the warning.

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


More information about the llvm-commits mailing list