xref: /llvm-project/llvm/test/tools/llvm-profdata/memprof-buildid.test (revision 932d7b9ddd23bfbe9ac1e8a2dabab8e457993ed4)
1REQUIRES: x86_64-linux
2
3To update the inputs used below run Inputs/update_memprof_inputs.sh /path/to/updated/clang
4RUN: llvm-readelf --notes %p/Inputs/buildid.memprofexe > %t1.txt
5RUN: llvm-profdata show --memory %p/Inputs/buildid.memprofraw --profiled-binary %p/Inputs/buildid.memprofexe -o -  > %t2.txt
6RUN: cat %t1.txt %t2.txt | FileCheck %s
7
8Test that we print out the profile build ids when --profiled-binary is empty.
9RUN: not llvm-profdata show --memory %p/Inputs/buildid.memprofraw -o - 2> %t3.txt
10RUN: cat %t1.txt %t3.txt | FileCheck %s
11
12COM: First extract the id from the llvm-readelf output.
13CHECK: Build ID: [[ID:[[:xdigit:]]+]]
14
15COM: Then match it with the profdata output.
16CHECK-COUNT-1: BuildId: {{.*}}[[ID]]
17