1 // RUN: %clang_cc1 -fsanitize=memory -fsanitize-memory-use-after-dtor -disable-llvm-passes -std=c++11 -triple=x86_64-pc-linux -emit-llvm -debug-info-kind=line-tables-only -o - %s | FileCheck %s --implicit-check-not="call void @__sanitizer_"
2 // RUN: %clang_cc1 -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -disable-llvm-passes -std=c++11 -triple=x86_64-pc-linux -emit-llvm -debug-info-kind=line-tables-only -o - %s | FileCheck %s --implicit-check-not="call void @__sanitizer_"
4 // Base dtor poisons members
5 // Complete dtor poisons vtable ptr after destroying members and
19 class Derived
: public Base
{
32 // Invoke base destructor. No vtable pointer to poison.
33 // CHECK-LABEL: define {{.*}}DerivedD1Ev
34 // CHECK: call void {{.*}}DerivedD2Ev
37 // CHECK-LABEL: define {{.*}}DerivedD0Ev
38 // CHECK: call void {{.*}}DerivedD1Ev
41 // Invokes base destructor, and poison vtable pointer.
42 // CHECK-LABEL: define {{.*}}BaseD1Ev
43 // CHECK: call void {{.*}}BaseD2Ev
46 // CHECK-LABEL: define {{.*}}BaseD0Ev
47 // CHECK: call void {{.*}}BaseD1Ev
50 // Poison members and vtable ptr.
51 // CHECK-LABEL: define {{.*}}BaseD2Ev
52 // CHECK: call void @__sanitizer_dtor_callback_fields({{.*}}, !dbg ![[DI1:[0-9]+]]
53 // CHECK: call void @__sanitizer_dtor_callback_vptr({{.*}}){{.*}}, !dbg ![[DI2:[0-9]+]]
56 // Poison members and destroy non-virtual base.
57 // CHECK-LABEL: define {{.*}}DerivedD2Ev
58 // CHECK: call void @__sanitizer_dtor_callback_fields({{.*}}, !dbg ![[DI3:[0-9]+]]
59 // CHECK: call void {{.*}}BaseD2Ev
60 // CHECK: call void @__sanitizer_dtor_callback_vptr({{.*}}){{.*}}, !dbg ![[DI4:[0-9]+]]
63 // CHECK-LABEL: !DIFile{{.*}}cpp
65 // CHECK-DAG: ![[DI1]] = {{.*}}line: [[@LINE-55]]
66 // CHECK-DAG: ![[DI2]] = {{.*}}line: [[@LINE-50]]
67 // CHECK-DAG: ![[DI3]] = {{.*}}line: [[@LINE-46]]
68 // CHECK-DAG: ![[DI4]] = {{.*}}line: [[@LINE-41]]