mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 12:46:34 +00:00

While merging profiles, some fields in the input header, e.g. HashFunction, could be uninitialized leading to a UMR. Initialize merged header with the first input header. Fixes #109592
46 lines
1.1 KiB
Plaintext
46 lines
1.1 KiB
Plaintext
## 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
|
|
...
|