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.

llvm-svn: 247025
This commit is contained in:
Naomi Musgrave 2015-09-08 16:38:17 +00:00
parent fa84aa3fa1
commit 4e213984dd
1 changed files with 15 additions and 0 deletions

View File

@ -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