xref: /llvm-project/compiler-rt/test/profile/Posix/instrprof-shared-entry-coverage.test (revision 6ebf7cd7ed1b6502b3b18985f06b213a53381097)
1# When linking an instrumented shared libary, the produced raw profile may have
2# multiple headers which must be 8 byte aligned. Check that the counter section
3# sizes are 8 byte aligned when using function entry coverage by attempting to
4# merge the raw profile.
5
6RUN: mkdir -p %t.d
7RUN: %clang_pgogen -mllvm -pgo-function-entry-coverage -o %t.d/libfoo.so -fPIC -shared %S/../Inputs/instrprof-shared-lib.c
8RUN: %clang_pgogen -mllvm -pgo-function-entry-coverage -o %t -L%t.d -rpath %t.d -lfoo %S/../Inputs/instrprof-shared-main.c
9RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
10RUN: llvm-profdata merge -o %t.profdata %t.profraw
11RUN: llvm-profdata show --covered %t.profdata | FileCheck %s
12
13CHECK-DAG: main
14CHECK-DAG: foo
15