28 lines · plain
1You need a checkout of clang with compiler-rt to generate the2binary file here. These shell commands can be used to regenerate3it.4$ SRC=path/to/llvm5$ CFE=$SRC/tools/clang6$ TESTDIR=$SRC/test/tools/llvm-profdata7$ CFE_TESTDIR=$CFE/test/Profile8$ clang -o a.out -fprofile-instr-generate $CFE_TESTDIR/c-general.c -mllvm -enable-name-compression=false9$ LLVM_PROFILE_FILE=$TESTDIR/Inputs/c-general.profraw ./a.out10 11RUN: llvm-profdata show %p/Inputs/c-general.profraw -o - | FileCheck %s12RUN: llvm-profdata show %p/Inputs/c-general.profraw --topn=3 -o - | FileCheck %s --check-prefix=TOPN13RUN: llvm-profdata show %p/Inputs/c-general.profraw -o - --function=switches | FileCheck %s -check-prefixes=SWITCHES,CHECK14 15SWITCHES-LABEL: Counters:16SWITCHES-NEXT: switches:17SWITCHES-NEXT: Hash: 0x0099a0c98383683e18SWITCHES-NEXT: Counters: 1919SWITCHES-NEXT: Function count: 120SWITCHES-LABEL: Functions shown: 121 22CHECK-LABEL: Total functions: 1223CHECK-NEXT: Maximum function count: 124CHECK-NEXT: Maximum internal block count: 10025TOPN: simple_loops, max count = 10026TOPN-NEXT: conditionals, max count = 10027TOPN-NEXT: boolean_operators, max count = 10028