Files
clang-p2996/compiler-rt/test/profile/ContinuousSyncMode/image-with-no-counters.c
Vedant Kumar 7014a10161 [profile] Skip mmap() if there are no counters
If there are no counters, an mmap() of the counters section would fail
due to the size argument being too small (EINVAL).

rdar://78175925

Differential Revision: https://reviews.llvm.org/D102735
2021-05-19 09:31:40 -07:00

12 lines
428 B
C

// REQUIRES: darwin
// RUN: echo "static void dead_code(void) {}" > %t.dso.c
// RUN: %clang_profgen -fcoverage-mapping -O3 -dynamiclib -o %t.dso.dylib %t.dso.c
// RUN: %clang_profgen -fcoverage-mapping -O3 -o %t.exe %s %t.dso.dylib
// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe 2>&1 | count 0
// RUN: llvm-profdata show --counts --all-functions %t.profraw | FileCheck %s
// CHECK: Total functions: 1
int main() {}