Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / X86 / x86_64-instrument-functions.c
blobb2cef133ff0480c7e7b2d15dc6ccafb226403546
1 // REQUIRES: x86-registered-target
2 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -S -finstrument-functions -O0 -o - -emit-llvm %s | FileCheck %s
3 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -S -finstrument-functions -O2 -o - -emit-llvm %s | FileCheck %s
4 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -S -finstrument-functions-after-inlining -O2 -o - -emit-llvm %s | FileCheck -check-prefix=NOINLINE %s
6 __attribute__((always_inline)) int leaf(int x) {
7 return x;
8 // CHECK-LABEL: define {{.*}} @leaf
9 // CHECK: call void @__cyg_profile_func_enter
10 // CHECK-NOT: cyg_profile
11 // CHECK: call void @__cyg_profile_func_exit
12 // CHECK-NOT: cyg_profile
13 // CHECK: ret
16 int root(int x) {
17 return leaf(x);
18 // CHECK-LABEL: define {{.*}} @root
19 // CHECK: call void @__cyg_profile_func_enter
20 // CHECK-NOT: cyg_profile
22 // Inlined from leaf():
23 // CHECK: call void @__cyg_profile_func_enter
24 // CHECK-NOT: cyg_profile
25 // CHECK: call void @__cyg_profile_func_exit
26 // CHECK-NOT: cyg_profile
28 // CHECK: call void @__cyg_profile_func_exit
29 // CHECK: ret
31 // NOINLINE-LABEL: define {{.*}} @root
32 // NOINLINE: call void @__cyg_profile_func_enter
33 // NOINLINE-NOT: cyg_profile
34 // NOINLINE: call void @__cyg_profile_func_exit
35 // NOINLINE-NOT: cyg_profile
36 // NOINLINE: ret