1 // RUN: %clang_cc1 -fsanitize=memory -O0 -fsanitize-memory-use-after-dtor -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 -fsanitize=memory -O1 -disable-llvm-passes -fsanitize-memory-use-after-dtor -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_"
30 virtual ~VirtualBase() {}
33 struct Derived
: public Base
, public virtual VirtualBase
{
46 // Derived: int, Vector, Base, VirtualBase
48 // CHECK-LABEL: define {{.*}}ZN7DerivedD1Ev
49 // CHECK: call void {{.*}}ZN11VirtualBaseD2Ev
50 // CHECK: call void @__sanitizer_dtor_callback_vptr({{.*}}){{.*}}, !dbg ![[DI0:[0-9]+]]
53 // CHECK-LABEL: define {{.*}}ZN7DerivedD0Ev
56 // CHECK-LABEL: define {{.*}}ZN11VirtualBaseD1Ev
59 // CHECK-LABEL: define {{.*}}ZN11VirtualBaseD0Ev
63 // CHECK-LABEL: define {{.*}}ZN11VirtualBaseD2Ev
64 // CHECK: call void @__sanitizer_dtor_callback_fields({{.*}}, i64 8){{.*}}, !dbg ![[DI1:[0-9]+]]
65 // CHECK: call void @__sanitizer_dtor_callback_vptr({{.*}}){{.*}}{{.*}}, !dbg ![[DI2:[0-9]+]]
68 // poison int and double
69 // CHECK-LABEL: define {{.*}}ZN4BaseD2Ev
70 // CHECK: call void @__sanitizer_dtor_callback_fields({{.*}}, i64 16){{.*}}, !dbg ![[DI3:[0-9]+]]
71 // CHECK: call void @__sanitizer_dtor_callback_vptr({{.*}}{{.*}}, !dbg ![[DI4:[0-9]+]]
74 // poison int, ignore vector, poison int
75 // CHECK-LABEL: define {{.*}}ZN7DerivedD2Ev
76 // CHECK: call void @__sanitizer_dtor_callback_fields({{.*}}, i64 4){{.*}}, !dbg ![[DI5:[0-9]+]]
77 // CHECK: call void {{.*}}ZN6VectorIiED1Ev
78 // CHECK: call void @__sanitizer_dtor_callback_fields({{.*}}, i64 4){{.*}}, !dbg ![[DI6:[0-9]+]]
79 // CHECK: call void {{.*}}ZN4BaseD2Ev
83 // CHECK-LABEL: define {{.*}}ZN6VectorIiED2Ev
84 // CHECK: call void @__sanitizer_dtor_callback_fields({{.*}}, i64 4){{.*}}, !dbg ![[DI7:[0-9]+]]
87 // CHECK-LABEL: !DIFile{{.*}}.cpp
89 // CHECK-DAG: ![[DI0]] = {{.*}}line: [[@LINE-49]]
90 // CHECK-DAG: ![[DI1]] = {{.*}}line: [[@LINE-66]]
91 // CHECK-DAG: ![[DI2]] = {{.*}}line: [[@LINE-61]]
92 // CHECK-DAG: ![[DI3]] = {{.*}}line: [[@LINE-78]]
93 // CHECK-DAG: ![[DI5]] = {{.*}}line: [[@LINE-57]]
94 // CHECK-DAG: ![[DI6]] = {{.*}}line: [[@LINE-60]]
95 // CHECK-DAG: ![[DI7]] = {{.*}}line: [[@LINE-88]]