r247025 - Failing test highlighting no poisoning if dtor undeclared.
Naomi Musgrave via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 8 09:38:17 PDT 2015
Author: nmusgrave
Date: Tue Sep 8 11:38:17 2015
New Revision: 247025
URL: http://llvm.org/viewvc/llvm-project?rev=247025&view=rev
Log:
Failing test highlighting no poisoning if dtor undeclared.
Summary:
If class or struct has not declared a destructor,
no destructor is emitted, and members are not poisoned
after destruction. This case highlights bug in current
implementation of use-after-dtor poisoning (detailed
in https://github.com/google/sanitizers/issues/596).
Reviewers: eugenis, kcc
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D12616
Only check simplest object for existence of sanitizing callback.
Rename test.
Added:
cfe/trunk/test/CodeGenCXX/sanitize-dtor-trivial.cpp
Added: cfe/trunk/test/CodeGenCXX/sanitize-dtor-trivial.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/sanitize-dtor-trivial.cpp?rev=247025&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/sanitize-dtor-trivial.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/sanitize-dtor-trivial.cpp Tue Sep 8 11:38:17 2015
@@ -0,0 +1,15 @@
+// Test -fsanitize-memory-use-after-dtor
+// RUN: %clang_cc1 -O0 -fsanitize=memory -fsanitize-memory-use-after-dtor -disable-llvm-optzns -std=c++11 -triple=x86_64-pc-linux -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -disable-llvm-optzns -std=c++11 -triple=x86_64-pc-linux -emit-llvm -o - %s | FileCheck %s
+
+// TODO Success pending on resolution of issue:
+// https://github.com/google/sanitizers/issues/596
+// XFAIL: *
+
+struct Trivial {
+ int a;
+ int b;
+};
+Trivial t;
+
+// CHECK: call void @__sanitizer_dtor_callback
More information about the cfe-commits
mailing list