28 lines · plain
1Test the input file names overlap with the output file names.2 3This is OK for merging instrument profiles.4RUN: cp %S/Inputs/same-name-1.proftext %t.0.proftext5RUN: llvm-profdata merge -o %t.0.profdata -text %t.0.proftext %t.0.proftext6RUN: llvm-profdata show -counts -all-functions %t.0.profdata -o %t_show_07RUN: llvm-profdata show -counts -all-functions %S/Inputs/same-name-2.proftext -o %t_show_18RUN: diff %t_show_0 %t_show_19RUN: llvm-profdata merge -o %t.1.profdata %S/Inputs/same-name-1.proftext10RUN: llvm-profdata merge -o %t.1.profdata %t.1.profdata %t.1.profdata11RUN: llvm-profdata show -counts -all-functions %t.1.profdata -o %t_show_212RUN: diff %t_show_2 %t_show_113 14We report error for the show command.15RUN: not llvm-profdata show -o %t.1.profdata %t.1.profdata 2>&1 | FileCheck %s16CHECK: llvm-profdata{{.*}} show: Input file name cannot be the same as the output file name!17 18This is OK for merging sample fdo profiles.19RUN: cp %S/Inputs/same-name-3.proftext %t.3.proftext20RUN: llvm-profdata merge --sample -o %t.3.profdata -text %t.3.proftext %t.3.proftext21RUN: llvm-profdata show --sample -counts -all-functions %t.3.profdata -o %t_show_322RUN: llvm-profdata show --sample -counts -all-functions %S/Inputs/same-name-4.proftext -o %t_show_423RUN: diff %t_show_3 %t_show_424RUN: llvm-profdata merge --sample -o %t.5.profdata %S/Inputs/same-name-3.proftext25RUN: llvm-profdata merge --sample -o %t.5.profdata %t.5.profdata %t.5.profdata26RUN: llvm-profdata show --sample -counts -all-functions %t.5.profdata -o %t_show_627RUN: diff %t_show_6 %t_show_428