aboutsummaryrefslogtreecommitdiff
path: root/bolt/test/merge-fdata-uninitialized-header.test
blob: 533696127841176d64e03442d1286472f3ac7bca (plain)
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
## Test that merge-fdata correctly handles YAML header with an uninitialized
## fields. a.yaml does not have hash-func set and it used to crash merge-fdata.

# REQUIRES: system-linux

# RUN: split-file %s %t
# RUN: not merge-fdata %t/a.yaml %t/b.yaml 2>&1 | FileCheck %s

# CHECK: cannot merge profiles with different hash functions

#--- a.yaml
---
header:
  profile-version: 1
  binary-name:     'a.out'
  binary-build-id: '<unknown>'
  profile-flags:   [ lbr ]
  profile-origin:  branch profile reader
  profile-events:  ''
  dfs-order:       false
functions:
  - name:            'main'
    fid:             1
    hash:            0x50BBA3441D436491
    exec:            1
    nblocks:         0
...
#--- b.yaml
---
header:
  profile-version: 1
  binary-name:     'a.out'
  binary-build-id: '<unknown>'
  profile-flags:   [ lbr ]
  profile-origin:  branch profile reader
  profile-events:  ''
  dfs-order:       false
  hash-func: xxh3
functions:
  - name:            'main'
    fid:             1
    hash:            0x50BBA3441D436491
    exec:            1
    nblocks:         0
...