xref: /aosp_15_r20/external/clang/test/Profile/cxx-virtual-destructor-calls.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -main-file-name cxx-virtual-destructor-calls.cpp %s -o - -fprofile-instrument=clang | FileCheck %s
2*67e74705SXin Li 
3*67e74705SXin Li struct Member {
4*67e74705SXin Li   ~Member();
5*67e74705SXin Li };
6*67e74705SXin Li 
7*67e74705SXin Li struct A {
8*67e74705SXin Li   virtual ~A();
9*67e74705SXin Li };
10*67e74705SXin Li 
11*67e74705SXin Li struct B : A {
12*67e74705SXin Li   Member m;
13*67e74705SXin Li   virtual ~B();
14*67e74705SXin Li };
15*67e74705SXin Li 
16*67e74705SXin Li // Base dtor
17*67e74705SXin Li // CHECK: @__profn__ZN1BD2Ev = private constant [9 x i8] c"_ZN1BD2Ev"
18*67e74705SXin Li 
19*67e74705SXin Li // Complete dtor must not be instrumented
20*67e74705SXin Li // CHECK-NOT: @__profn__ZN1BD1Ev = private constant [9 x i8] c"_ZN1BD1Ev"
21*67e74705SXin Li 
22*67e74705SXin Li // Deleting dtor must not be instrumented
23*67e74705SXin Li // CHECK-NOT: @__profn__ZN1BD0Ev = private constant [9 x i8] c"_ZN1BD0Ev"
24*67e74705SXin Li 
25*67e74705SXin Li // Base dtor counters and profile data
26*67e74705SXin Li // CHECK: @__profc__ZN1BD2Ev = private global [1 x i64] zeroinitializer
27*67e74705SXin Li // CHECK: @__profd__ZN1BD2Ev =
28*67e74705SXin Li 
29*67e74705SXin Li // Complete dtor counters and profile data must absent
30*67e74705SXin Li // CHECK-NOT: @__profc__ZN1BD1Ev = private global [1 x i64] zeroinitializer
31*67e74705SXin Li // CHECK-NOT: @__profd__ZN1BD1Ev =
32*67e74705SXin Li 
33*67e74705SXin Li // Deleting dtor counters and profile data must absent
34*67e74705SXin Li // CHECK-NOT: @__profc__ZN1BD0Ev = private global [1 x i64] zeroinitializer
35*67e74705SXin Li // CHECK-NOT: @__profd__ZN1BD0Ev =
36*67e74705SXin Li 
~B()37*67e74705SXin Li B::~B() { }
38