llvm/test/tools/llvm-profdata/merge_empty_profile.test
Rong Xu c8872308b4 [PGO] Fix bogus warning for merging empty llvm profile file
Profile runtime can generate an empty raw profile (when there is no function in
the shared library). This empty profile is treated as a text format profile.  A
test format profile without the flag of "#IR" is thought to be a clang
generated profile.  So in llvm profile merging, we will get a bogus warning of
"Merge IR generated profile with Clang generated profile."

The fix here is to skip the empty profile (when the buffer size is 0) for
profile merge.

Reviewers: vsk, davidxl

Differential Revision: http://reviews.llvm.org/D25687


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284659 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 22:51:17 +00:00

18 lines
589 B
Plaintext

# Tests for merge of empty profile files.
RUN: touch %t_empty.proftext
RUN: llvm-profdata merge -text -o %t_clang.proftext %t_empty.proftext %p/Inputs/clang_profile.proftext
RUN: FileCheck --input-file=%t_clang.proftext %s -check-prefix=CLANG_PROF_TEXT
CLANG_PROF_TEXT: main
CLANG_PROF_TEXT: 0
CLANG_PROF_TEXT: 1
CLANG_PROF_TEXT: 1
RUN: llvm-profdata merge -text -o %t_ir.proftext %t_empty.proftext %p/Inputs/IR_profile.proftext
RUN: FileCheck --input-file=%t_ir.proftext %s -check-prefix=IR_PROF_TEXT
IR_PROF_TEXT: :ir
IR_PROF_TEXT: main
IR_PROF_TEXT: 0
IR_PROF_TEXT: 1
IR_PROF_TEXT: 1