brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.4 KiB · 4c28a4a Raw
57 lines · plain
1Tests for weighted merge of sample profiles.2 31- Merge the foo and bar profiles with unity weight and verify the combined output4RUN: llvm-profdata merge -sample -text -weighted-input=1,%p/Inputs/weight-sample-bar.proftext -weighted-input=1,%p/Inputs/weight-sample-foo.proftext -o - | FileCheck %s -check-prefix=1X_1X_WEIGHT5RUN: llvm-profdata merge -sample -text -weighted-input=1,%p/Inputs/weight-sample-bar.proftext %p/Inputs/weight-sample-foo.proftext -o - | FileCheck %s -check-prefix=1X_1X_WEIGHT61X_1X_WEIGHT-DAG: foo:1763288:3532771X_1X_WEIGHT-DAG:  7: 3532781X_1X_WEIGHT-DAG:  8: 3532791X_1X_WEIGHT-DAG:  9: 6930101X_1X_WEIGHT-DAG:  10: 29341111X_1X_WEIGHT-DAG:  11: 11906121X_1X_WEIGHT-DAG:  13: 18185 foo:19531131X_1X_WEIGHT-DAG:  15: 36458141X_1X_WEIGHT-DAG: bar:1772037:35370151X_1X_WEIGHT-DAG:  17: 35370161X_1X_WEIGHT-DAG:  18: 35370171X_1X_WEIGHT-DAG:  19: 7005181X_1X_WEIGHT-DAG:  20: 29407191X_1X_WEIGHT-DAG:  21: 12170201X_1X_WEIGHT-DAG:  23: 18150 bar:19829211X_1X_WEIGHT-DAG:  25: 3666622 232- Merge the foo and bar profiles with weight 3x and 5x respectively and verify the combined output24RUN: llvm-profdata merge -sample -text -weighted-input=3,%p/Inputs/weight-sample-bar.proftext -weighted-input=5,%p/Inputs/weight-sample-foo.proftext -o - | FileCheck %s -check-prefix=3X_5X_WEIGHT253X_5X_WEIGHT-DAG: foo:8816440:176635263X_5X_WEIGHT-DAG:  7: 176635273X_5X_WEIGHT-DAG:  8: 176635283X_5X_WEIGHT-DAG:  9: 34650293X_5X_WEIGHT-DAG:  10: 146705303X_5X_WEIGHT-DAG:  11: 59530313X_5X_WEIGHT-DAG:  13: 90925 foo:97655323X_5X_WEIGHT-DAG:  15: 182290333X_5X_WEIGHT-DAG: bar:5316111:106110343X_5X_WEIGHT-DAG:  17: 106110353X_5X_WEIGHT-DAG:  18: 106110363X_5X_WEIGHT-DAG:  19: 21015373X_5X_WEIGHT-DAG:  20: 88221383X_5X_WEIGHT-DAG:  21: 36510393X_5X_WEIGHT-DAG:  23: 54450 bar:59487403X_5X_WEIGHT-DAG:  25: 10999841 423- Bad merge: invalid weight43RUN: not llvm-profdata merge -sample -weighted-input=3,%p/Inputs/weight-sample-bar.proftext -weighted-input=0,%p/Inputs/weight-sample-foo.proftext -o %t.out 2>&1 | FileCheck %s -check-prefix=INVALID_WEIGHT44RUN: not llvm-profdata merge -sample -weighted-input=3,%p/Inputs/weight-sample-bar.proftext -weighted-input=0.75,%p/Inputs/weight-sample-foo.proftext -o %t.out 2>&1 | FileCheck %s -check-prefix=INVALID_WEIGHT45RUN: not llvm-profdata merge -sample -weighted-input=3,%p/Inputs/weight-sample-bar.proftext -weighted-input=-5,%p/Inputs/weight-sample-foo.proftext -o %t.out 2>&1 | FileCheck %s -check-prefix=INVALID_WEIGHT46RUN: not llvm-profdata merge -sample -weighted-input=3,%p/Inputs/weight-sample-bar.proftext -weighted-input=,%p/Inputs/weight-sample-foo.proftext -o %t.out 2>&1 | FileCheck %s -check-prefix=INVALID_WEIGHT47RUN: not llvm-profdata merge -sample -weighted-input=3,%p/Inputs/weight-sample-bar.proftext -weighted-input=%p/Inputs/weight-sample-foo.proftext -o %t.out 2>&1 | FileCheck %s -check-prefix=INVALID_WEIGHT48INVALID_WEIGHT: error: input weight must be a positive integer49 504- Bad merge: input path does not exist51RUN: not llvm-profdata merge -sample -weighted-input=3,%p/Inputs/does-not-exist.proftext -weighted-input=2,%p/Inputs/does-not-exist-either.proftext -o %t.out 2>&1 | FileCheck -DMSG=%errc_ENOENT %s -check-prefix=INVALID_INPUT52INVALID_INPUT: {{.*}}: {{.*}}does-not-exist.proftext: [[MSG]]53 545- No inputs55RUN: not llvm-profdata merge -sample -o %t.out 2>&1 | FileCheck %s -check-prefix=NO_INPUT56NO_INPUT: {{.*}}: no input files specified. See llvm-profdata{{(\.EXE|\.exe)?}} merge -help57