26 lines · c
1// RUN: mkdir -p %t.d && cd %t.d2// RUN: rm -f *.profraw3// RUN: %clang_pgogen %s -o a.out4 5// Need to run a.out twice. On the second time, a merge will occur, which will6// trigger an mmap.7// RUN: ./a.out8// RUN: llvm-profdata show default_*.profraw --all-functions --counts --memop-sizes 2>&1 | FileCheck %s -check-prefix=PROFDATA9// RUN: env LLVM_PROFILE_NO_MMAP=1 LLVM_PROFILE_VERBOSE=1 ./a.out 2>&1 | FileCheck %s10// RUN: llvm-profdata show default_*.profraw --all-functions --counts --memop-sizes 2>&1 | FileCheck %s -check-prefix=PROFDATA211 12// CHECK: could not use mmap; using fread instead13// PROFDATA: Block counts: [1]14// PROFDATA: [ 0, 0, 1 ]15// PROFDATA: Maximum function count: 116// PROFDATA2: Block counts: [2]17// PROFDATA2: [ 0, 0, 2 ]18// PROFDATA2: Maximum function count: 219 20int ar[8];21int main() {22 __builtin_memcpy(ar, ar + 2, ar[0]);23 __builtin_memcpy(ar, ar + 2, ar[2]);24 return ar[2];25}26