1 Test the input file names overlap with the output file names.
3 This is OK for merging instrument profiles.
4 RUN: cp %S/Inputs/same-name-1.proftext %t.0.proftext
5 RUN: llvm-profdata merge -o %t.0.profdata -text %t.0.proftext %t.0.proftext
6 RUN: llvm-profdata show -counts -all-functions %t.0.profdata -o %t_show_0
7 RUN: llvm-profdata show -counts -all-functions %S/Inputs/same-name-2.proftext -o %t_show_1
8 RUN: diff %t_show_0 %t_show_1
9 RUN: llvm-profdata merge -o %t.1.profdata %S/Inputs/same-name-1.proftext
10 RUN: llvm-profdata merge -o %t.1.profdata %t.1.profdata %t.1.profdata
11 RUN: llvm-profdata show -counts -all-functions %t.1.profdata -o %t_show_2
12 RUN: diff %t_show_2 %t_show_1
14 We report error for the show command.
15 RUN: not llvm-profdata show -o %t.1.profdata %t.1.profdata 2>&1 | FileCheck %s
16 CHECK: llvm-profdata{{.*}} show: Input file name cannot be the same as the output file name!
18 This is OK for merging sample fdo profiles.
19 RUN: cp %S/Inputs/same-name-3.proftext %t.3.proftext
20 RUN: llvm-profdata merge --sample -o %t.3.profdata -text %t.3.proftext %t.3.proftext
21 RUN: llvm-profdata show --sample -counts -all-functions %t.3.profdata -o %t_show_3
22 RUN: llvm-profdata show --sample -counts -all-functions %S/Inputs/same-name-4.proftext -o %t_show_4
23 RUN: diff %t_show_3 %t_show_4
24 RUN: llvm-profdata merge --sample -o %t.5.profdata %S/Inputs/same-name-3.proftext
25 RUN: llvm-profdata merge --sample -o %t.5.profdata %t.5.profdata %t.5.profdata
26 RUN: llvm-profdata show --sample -counts -all-functions %t.5.profdata -o %t_show_6
27 RUN: diff %t_show_6 %t_show_4