1 Tests for weighted merge of sample profiles.
3 1- Merge the foo and bar profiles with unity weight and verify the combined output
4 RUN: llvm-profdata merge --sample --text %p/Inputs/weight-sample-bar.proftext:1 %p/Inputs/weight-sample-foo.proftext:1 -o - | FileCheck %s --check-prefix=WEIGHT1
5 WEIGHT1: foo:1763288:35327
11 WEIGHT1: 13: 18185 foo:19531
13 WEIGHT1: bar:1772037:35370
19 WEIGHT1: 23: 18150 bar:19829
22 2- Merge the foo and bar profiles with weight 3x and 5x respectively and verify the combined output
23 RUN: llvm-profdata merge --sample --text %p/Inputs/weight-sample-bar.proftext:3 %p/Inputs/weight-sample-foo.proftext:5 -o - | FileCheck %s --check-prefix=WEIGHT2
24 WEIGHT2: foo:8816440:176635
30 WEIGHT2: 13: 90925 foo:97655
32 WEIGHT2: bar:5316111:106110
38 WEIGHT2: 23: 54450 bar:59487
41 3- Bad merge: foo and bar profiles with invalid weights
42 RUN: not llvm-profdata merge --sample --text %p/Inputs/weight-sample-bar.proftext:3 %p/Inputs/weight-sample-foo.proftext:-5 -o %t.out 2>&1 | FileCheck %s --check-prefix=ERROR3
43 ERROR3: error: Input weight must be a positive integer.