[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / bolt / test / runtime / AArch64 / instrumentation-ind-call.c
blob76ee8c05dd2998dd708bb719f82dda4e1fb8115c
1 #include <stdio.h>
3 typedef int (*func_ptr)(int, int);
5 int add(int a, int b) { return a + b; }
7 int main() {
8 func_ptr fun;
9 fun = add;
10 int sum = fun(10, 20); // indirect call to 'add'
11 printf("The sum is: %d\n", sum);
12 return 0;
15 REQUIRES: system-linux,bolt-runtime
17 RUN: %clang %cflags %s -o %t.exe -Wl,-q -nopie -fpie
19 RUN: llvm-bolt %t.exe --instrument --instrumentation-file=%t.fdata \
20 RUN: -o %t.instrumented
22 # Instrumented program needs to finish returning zero
23 RUN: %t.instrumented | FileCheck %s -check-prefix=CHECK-OUTPUT
25 # Test that the instrumented data makes sense
26 RUN: llvm-bolt %t.exe -o %t.bolted --data %t.fdata \
27 RUN: --reorder-blocks=ext-tsp --reorder-functions=hfsort+ \
28 RUN: --print-only=main --print-finalized | FileCheck %s
30 RUN: %t.bolted | FileCheck %s -check-prefix=CHECK-OUTPUT
32 CHECK-OUTPUT: The sum is: 30
34 # Check that our indirect call has 1 hit recorded in the fdata file and that
35 # this was processed correctly by BOLT
36 CHECK: blr x8 # CallProfile: 1 (0 misses) :
37 CHECK-NEXT: { add: 1 (0 misses) }