2018-01-11 04:27:48 +08:00
|
|
|
// Test with the flag -fno-sanitize-memory-use-after-dtor, to ensure that
|
2015-07-16 08:25:45 +08:00
|
|
|
// instrumentation is not erroneously inserted
|
2018-01-11 04:27:48 +08:00
|
|
|
// RUN: %clang_cc1 -fsanitize=memory -fno-sanitize-memory-use-after-dtor -triple=x86_64-pc-linux -emit-llvm -o - %s | FileCheck %s
|
2015-07-16 08:25:45 +08:00
|
|
|
|
|
|
|
struct Simple {
|
2018-01-11 04:27:48 +08:00
|
|
|
int x;
|
2015-07-16 08:25:45 +08:00
|
|
|
~Simple() {}
|
|
|
|
};
|
|
|
|
Simple s;
|
|
|
|
// CHECK-LABEL: define {{.*}}SimpleD1Ev
|
|
|
|
// CHECK-NOT: call void @__sanitizer_dtor_callback
|
|
|
|
|
|
|
|
struct Inlined {
|
2018-01-11 04:27:48 +08:00
|
|
|
int x;
|
2015-07-16 08:25:45 +08:00
|
|
|
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
|