[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / pseudo-probe-emit.c
blob360f831e842945bcbcc19639a9a38dc7bb411912
1 // RUN: %clang_cc1 -O0 -fpseudo-probe-for-profiling -debug-info-kind=limited -emit-llvm -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -O2 -fpseudo-probe-for-profiling -debug-info-kind=limited -emit-llvm -o - %s | FileCheck %s
4 // Check the generation of pseudoprobe intrinsic call
6 void bar(void);
7 void go(void);
9 void foo(int x) {
10 // CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 1, i32 0, i64 -1)
11 if (x == 0)
12 // CHECK: call void @llvm.pseudoprobe(i64 [[#GUID]], i64 2, i32 0, i64 -1)
13 bar(); // probe id : 3
14 else
15 // CHECK: call void @llvm.pseudoprobe(i64 [[#GUID]], i64 4, i32 0, i64 -1)
16 go(); // probe id : 5
17 // CHECK: call void @llvm.pseudoprobe(i64 [[#GUID]], i64 6, i32 0, i64 -1)