File: sample-fs.test

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (58 lines) | stat: -rw-r--r-- 3,046 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Basic tests for sample profiles using fs discriminators.

1- Show command and keep all the discrimiantor bits
RUN: llvm-profdata show --sample %p/Inputs/sample-fs.proftext -profile-isfs | FileCheck %s --check-prefix=SHOW1
RUN: llvm-profdata show --sample %p/Inputs/sample-fs.proftext -profile-isfs -fs-discriminator-pass=PassLast | FileCheck %s --check-prefix=SHOW1
SHOW1: Function: main: 6436, 0, 6 sampled lines
SHOW1: Samples collected in the function's body {
SHOW1:   4: 534
SHOW1:   4.2: 534
SHOW1:   4.738209026: 1068
SHOW1:   5: 1075
SHOW1:   5.1: 1075
SHOW1:   5.738209025: 2150
SHOW1: }

2- Show command and keep only the base discriminator bits
RUN: llvm-profdata show --sample %p/Inputs/sample-fs.proftext -profile-isfs -fs-discriminator-pass=Base | FileCheck %s --check-prefix=SHOW2
SHOW2: Function: main: 6436, 0, 4 sampled lines
SHOW2: Samples collected in the function's body {
SHOW2:   4: 534
SHOW2:   4.2: 1602
SHOW2:   5: 1075
SHOW2:   5.1: 3225
SHOW2: }

3- Show command and keep only the base discriminator bits and first pass of FS discriminator
RUN: llvm-profdata show --sample %p/Inputs/sample-fs.proftext -profile-isfs -fs-discriminator-pass=Pass1 | FileCheck %s --check-prefix=SHOW3
Function: main: 6436, 0, 6 sampled lines
SHOW3: Samples collected in the function's body {
SHOW3:   4: 534
SHOW3:   4.2: 534
SHOW3:   4.11522: 1068
SHOW3:   5: 1075
SHOW3:   5.1: 1075
SHOW3:   5.11521: 2150
SHOW3: }

4- Merge command and keep all the discrimiantor bits
RUN: llvm-profdata merge --sample %p/Inputs/sample-fs.proftext -profile-isfs -fs-discriminator-pass=PassLast --binary -o - | llvm-profdata show --sample - -o %t1-binary_1
RUN: llvm-profdata merge --sample %p/Inputs/sample-fs.proftext -profile-isfs --binary -o - | llvm-profdata show --sample - -o %t1-binary_2
RUN: llvm-profdata show --sample %p/Inputs/sample-fs.proftext -profile-isfs -o %t1-text
RUN: diff %t1-binary_1 %t1-text
RUN: diff %t1-binary_2 %t1-text

2- Merge command and keep only the base discriminator bits
RUN: llvm-profdata merge --sample %p/Inputs/sample-fs.proftext -profile-isfs -fs-discriminator-pass=Base --binary -o - | llvm-profdata show --sample - -o %t2-binary
RUN: llvm-profdata show --sample %p/Inputs/sample-fs.proftext -profile-isfs -fs-discriminator-pass=Base -o %t2-text
RUN: diff %t2-binary %t2-text

3- Merge command and keep only the base discriminator bits and first pass of FS discriminator
RUN: llvm-profdata merge --sample %p/Inputs/sample-fs.proftext -profile-isfs -fs-discriminator-pass=Pass1 --binary -o - | llvm-profdata show --sample - -o %t3-binary
RUN: llvm-profdata show --sample %p/Inputs/sample-fs.proftext -profile-isfs -fs-discriminator-pass=Pass1 -o %t3-text
RUN: diff %t3-binary %t3-text

4- ProfileIsFS is set properly in extbinary format from the internal option
RUN: llvm-profdata merge --sample %p/Inputs/sample-fs.proftext -profile-isfs --extbinary -o %t_extbin.afdo
RUN: llvm-profdata show --sample --show-sec-info-only %t_extbin.afdo | FileCheck %s --check-prefix=ISFSSET
ISFSSET: Flags: {fs-discriminator}