Justin Bogner | 821d747 | 2014-08-01 22:50:07 +0000 | [diff] [blame] | 1 | # Compatibility tests for older profile format versions. These ensure |
| 2 | # that we don't break compatibility with an older profile version |
| 3 | # without noticing it. |
| 4 | |
| 5 | # The input file at %S/Inputs/compat.profdata.v1 was generated with |
| 6 | # llvm-profdata merge from r214548. |
| 7 | |
| 8 | # RUN: llvm-profdata show %S/Inputs/compat.profdata.v1 --function function_count_only --counts | FileCheck %s -check-prefix=FUNC_COUNT_ONLY |
| 9 | function_count_only |
| 10 | 0 |
| 11 | 1 |
| 12 | 97531 |
| 13 | # FUNC_COUNT_ONLY: Hash: 0x{{0+$}} |
| 14 | # FUNC_COUNT_ONLY-NEXT: Counters: 1 |
| 15 | # FUNC_COUNT_ONLY-NEXT: Function count: 97531 |
| 16 | # FUNC_COUNT_ONLY-NEXT: Block counts: [] |
| 17 | |
| 18 | # RUN: llvm-profdata show %S/Inputs/compat.profdata.v1 --function "name with spaces" --counts | FileCheck %s -check-prefix=SPACES |
| 19 | name with spaces |
| 20 | 1024 |
| 21 | 2 |
| 22 | 0 |
| 23 | 0 |
| 24 | # SPACES: Hash: 0x{{0+}}400 |
| 25 | # SPACES-NEXT: Counters: 2 |
| 26 | # SPACES-NEXT: Function count: 0 |
| 27 | # SPACES-NEXT: Block counts: [0] |
| 28 | |
| 29 | # RUN: llvm-profdata show %S/Inputs/compat.profdata.v1 --function large_numbers --counts | FileCheck %s -check-prefix=LARGENUM |
| 30 | large_numbers |
| 31 | 4611686018427387903 |
| 32 | 6 |
| 33 | 2305843009213693952 |
| 34 | 1152921504606846976 |
| 35 | 576460752303423488 |
| 36 | 288230376151711744 |
| 37 | 144115188075855872 |
| 38 | 72057594037927936 |
| 39 | # LARGENUM: Hash: 0x3fffffffffffffff |
| 40 | # LARGENUM-NEXT: Counters: 6 |
| 41 | # LARGENUM-NEXT: Function count: 2305843009213693952 |
| 42 | # LARGENUM-NEXT: Block counts: [1152921504606846976, 576460752303423488, 288230376151711744, 144115188075855872, 72057594037927936] |
| 43 | |
| 44 | # RUN: llvm-profdata show %S/Inputs/compat.profdata.v1 | FileCheck %s -check-prefix=SUMMARY |
| 45 | # SUMMARY: Total functions: 3 |
| 46 | # SUMMARY: Maximum function count: 2305843009213693952 |
| 47 | # SUMMARY: Maximum internal block count: 1152921504606846976 |
Xinliang David Li | 0f87463 | 2015-12-03 01:05:31 +0000 | [diff] [blame] | 48 | |
| 49 | # RUN: llvm-profdata show %S/Inputs/compat.profdata.v2 -all-functions --counts | FileCheck %s -check-prefix=FORMATV2 |
| 50 | |
| 51 | # FORMATV2: Counters: |
| 52 | # FORMATV2-NEXT: foo: |
| 53 | # FORMATV2-NEXT: Hash: 0x000000000000000a |
| 54 | # FORMATV2-NEXT: Counters: 2 |
| 55 | # FORMATV2-NEXT: Function count: 499500 |
| 56 | # FORMATV2-NEXT: Block counts: [179900] |
| 57 | # FORMATV2-NEXT: main: |
| 58 | # FORMATV2-NEXT: Hash: 0x000000000000410a |
| 59 | # FORMATV2-NEXT: Counters: 4 |
| 60 | # FORMATV2-NEXT: Function count: 1 |
| 61 | # FORMATV2-NEXT: Block counts: [1000, 1000000, 499500] |
Adam Nemet | 852d12f | 2017-11-14 17:12:36 +0000 | [diff] [blame] | 62 | # FORMATV2-NEXT: Instrumentation level: Front-end |
Xinliang David Li | 0f87463 | 2015-12-03 01:05:31 +0000 | [diff] [blame] | 63 | # FORMATV2-NEXT: Functions shown: 2 |
| 64 | # FORMATV2-NEXT: Total functions: 2 |
| 65 | # FORMATV2-NEXT: Maximum function count: 499500 |
| 66 | # FORMATV2-NEXT: Maximum internal block count: 1000000 |
Xinliang David Li | 876ed52 | 2016-02-03 06:27:38 +0000 | [diff] [blame] | 67 | # |
| 68 | # RUN: llvm-profdata show %S/Inputs/compat.profdata.v4 -all-functions --counts | FileCheck %s -check-prefix=FORMATV4 |
Xinliang David Li | 0f87463 | 2015-12-03 01:05:31 +0000 | [diff] [blame] | 69 | |
Xinliang David Li | 876ed52 | 2016-02-03 06:27:38 +0000 | [diff] [blame] | 70 | # FORMATV4: Counters: |
| 71 | # FORMATV4: name with spaces: |
| 72 | # FORMATV4: Hash: 0x0000000000000400 |
| 73 | # FORMATV4: Counters: 2 |
| 74 | # FORMATV4: Function count: 0 |
| 75 | # FORMATV4: Block counts: [0] |
| 76 | # FORMATV4: function_count_only: |
| 77 | # FORMATV4: Hash: 0x0000000000000000 |
| 78 | # FORMATV4: Counters: 1 |
| 79 | # FORMATV4: Function count: 97531 |
| 80 | # FORMATV4: Block counts: [] |
| 81 | # FORMATV4: large_numbers: |
| 82 | # FORMATV4: Hash: 0x3fffffffffffffff |
| 83 | # FORMATV4: Counters: 6 |
| 84 | # FORMATV4: Function count: 2305843009213693952 |
| 85 | # FORMATV4: Block counts: [1152921504606846976, 576460752303423488, 288230376151711744, 144115188075855872, 72057594037927936] |
| 86 | # FORMATV4: Functions shown: 3 |
| 87 | # FORMATV4: Total functions: 3 |
| 88 | # FORMATV4: Maximum function count: 2305843009213693952 |
| 89 | # FORMATV4: Maximum internal block count: 1152921504606846976 |