1 // RUN: %clang_pgogen -o %t -O3 %s
2 // RUN: rm -rf %t.profdir
3 // RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t
4 // RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t
5 // RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t
6 // RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t 1
7 // RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t 1
8 // RUN: llvm-profdata show -counts -function=main -ic-targets -memop-sizes %t.profdir/default_*.profraw | FileCheck %s
20 __attribute__((noinline
)) void foo() {}
22 __attribute__((noinline
)) void bar() {
28 int main(int argc
, char *argv
[]) {
33 for (i
= 0; i
< 9; i
++)
35 for (i
= 0; i
< 99; i
++)
38 memcpy((void *)dst
, (void *)src
, n
);
39 for (i
= 0; i
< 6; i
++)
40 memcpy((void *)(dst
+ 2), (void *)src
, n
+ 1);
41 for (i
= 0; i
< 66; i
++)
42 memcpy((void *)(dst
+ 9), (void *)src
, n
+ 2);
48 // CHECK: Hash: 0x00030012a7ab6e87
50 // CHECK: Indirect Call Site Count: 3
51 // CHECK: Number of Memory Intrinsics Calls: 3
52 // CHECK: Block counts: [27, 297, 12, 132, 3, 2]
53 // CHECK: Indirect Target Results:
54 // CHECK: [ 0, foo, 3 ]
55 // CHECK: [ 1, foo, 27 ]
56 // CHECK: [ 2, foo, 297 ]
57 // CHECK: Memory Intrinsic Size Results:
59 // CHECK: [ 1, 5, 12 ]
60 // CHECK: [ 2, 6, 132 ]
61 // CHECK: Instrumentation level: IR
62 // CHECK: Functions shown: 1
63 // CHECK: Total functions: 3
64 // CHECK: Maximum function count: 327
65 // CHECK: Maximum internal block count: 297
66 // CHECK: Statistics for indirect call sites profile:
67 // CHECK: Total number of sites: 3
68 // CHECK: Total number of sites with values: 3
69 // CHECK: Total number of profiled values: 3
70 // CHECK: Value sites histogram:
71 // CHECK: NumTargets, SiteCount
73 // CHECK: Statistics for memory intrinsic calls sizes profile:
74 // CHECK: Total number of sites: 3
75 // CHECK: Total number of sites with values: 3
76 // CHECK: Total number of profiled values: 3
77 // CHECK: Value sites histogram:
78 // CHECK: NumTargets, SiteCount