mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 05:46:06 +00:00

Summary: Enable the compile-time flag -fsanitize-memory-use-after-dtor by default. Note that the run-time option MSAN_OPTIONS=poison_in_dtor=1 still needs to be enabled for destructors to be poisoned. Reviewers: eugenis, vitalybuka, kcc Reviewed By: eugenis, vitalybuka Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D37860 llvm-svn: 322221
26 lines
738 B
C++
26 lines
738 B
C++
// Test with the flag -fno-sanitize-memory-use-after-dtor, to ensure that
|
|
// instrumentation is not erroneously inserted
|
|
// RUN: %clang_cc1 -fsanitize=memory -fno-sanitize-memory-use-after-dtor -triple=x86_64-pc-linux -emit-llvm -o - %s | FileCheck %s
|
|
|
|
struct Simple {
|
|
int x;
|
|
~Simple() {}
|
|
};
|
|
Simple s;
|
|
// CHECK-LABEL: define {{.*}}SimpleD1Ev
|
|
// CHECK-NOT: call void @__sanitizer_dtor_callback
|
|
|
|
struct Inlined {
|
|
int x;
|
|
inline ~Inlined() {}
|
|
};
|
|
Inlined i;
|
|
// CHECK-LABEL: define {{.*}}InlinedD1Ev
|
|
// CHECK-NOT: call void @__sanitizer_dtor_callback
|
|
|
|
// CHECK-LABEL: define {{.*}}SimpleD2Ev
|
|
// CHECK-NOT: call void @__sanitizer_dtor_callback
|
|
|
|
// CHECK-LABEL: define {{.*}}InlinedD2Ev
|
|
// CHECK-NOT: call void @__sanitizer_dtor_callback
|