Nathan Slingerland | 48dd080 | 2015-12-16 21:45:43 +0000 | [diff] [blame] | 1 | Tests for overflow when merging instrumented profiles. |
| 2 | |
| 3 | 1- Merge profile having maximum counts with itself and verify overflow detected and saturation occurred |
| 4 | RUN: llvm-profdata merge -instr %p/Inputs/overflow-instr.proftext %p/Inputs/overflow-instr.proftext -o %t.out 2>&1 | FileCheck %s -check-prefix=MERGE_OVERFLOW |
| 5 | RUN: llvm-profdata show -instr %t.out | FileCheck %s --check-prefix=SHOW_OVERFLOW |
| 6 | MERGE_OVERFLOW: {{.*}}: overflow: Counter overflow |
| 7 | SHOW_OVERFLOW: Total functions: 1 |
| 8 | SHOW_OVERFLOW-NEXT: Maximum function count: 18446744073709551615 |
| 9 | SHOW_OVERFLOW-NEXT: Maximum internal block count: 18446744073709551615 |
| 10 | |
| 11 | 2- Merge profile having maximum counts by itself and verify no overflow |
| 12 | RUN: llvm-profdata merge -instr %p/Inputs/overflow-instr.proftext -o %t.out 2>&1 | FileCheck %s -check-prefix=MERGE_NO_OVERFLOW -allow-empty |
| 13 | RUN: llvm-profdata show -instr %t.out | FileCheck %s --check-prefix=SHOW_NO_OVERFLOW |
| 14 | MERGE_NO_OVERFLOW-NOT: {{.*}}: overflow: Counter overflow |
| 15 | SHOW_NO_OVERFLOW: Total functions: 1 |
| 16 | SHOW_NO_OVERFLOW-NEXT: Maximum function count: 18446744073709551615 |
| 17 | SHOW_NO_OVERFLOW-NEXT: Maximum internal block count: 18446744073709551615 |