| 1 |
// REQUIRES: x86-registered-target |
| 2 |
// RUN: %clang_cc1 -disable-llvm-passes -triple x86_64-unknown-unknown -finstrument-functions -O0 -o - -emit-llvm %s | FileCheck %s |
| 3 |
// RUN: %clang_cc1 -disable-llvm-passes -triple x86_64-unknown-unknown -finstrument-functions -O2 -o - -emit-llvm %s | FileCheck %s |
| 4 |
// RUN: %clang_cc1 -disable-llvm-passes -triple x86_64-unknown-unknown -finstrument-functions-after-inlining -O2 -o - -emit-llvm %s | FileCheck -check-prefix=NOINLINE %s |
| 5 |
|
| 6 |
__attribute__((always_inline)) int leaf(int x) { |
| 7 |
return x; |
| 8 |
// CHECK-LABEL: define {{.*}} @leaf(i32 noundef %x) #0 { |
| 9 |
} |
| 10 |
|
| 11 |
int root(int x) { |
| 12 |
return leaf(x); |
| 13 |
// CHECK-LABEL: define {{.*}} @root(i32 noundef %x) #1 { |
| 14 |
// NOINLINE-LABEL: define {{.*}} @root(i32 noundef %x) #1 { |
| 15 |
} |
| 16 |
|
| 17 |
// CHECK: attributes #0 = { {{.*}}"instrument-function-entry"="__cyg_profile_func_enter" "instrument-function-exit"="__cyg_profile_func_exit" |
| 18 |
// CHECK: attributes #1 = { {{.*}}"instrument-function-entry"="__cyg_profile_func_enter" "instrument-function-exit"="__cyg_profile_func_exit" |
| 19 |
// NOINLINE: attributes #0 = { {{.*}}"instrument-function-entry-inlined"="__cyg_profile_func_enter" "instrument-function-exit-inlined"="__cyg_profile_func_exit" |
| 20 |
// NOINLINE: attributes #1 = { {{.*}}"instrument-function-entry-inlined"="__cyg_profile_func_enter" "instrument-function-exit-inlined"="__cyg_profile_func_exit" |