Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / sanitize-dtor-tail-call.cpp
blob5cdf69edb9d041b81b93ce7cb8b9d74136c54251
1 // Test -fsanitize-memory-use-after-dtor
2 // RUN: %clang_cc1 -fsanitize=memory -fsanitize-memory-use-after-dtor -disable-llvm-passes -std=c++11 -triple=x86_64-pc-linux -emit-llvm -o - %s | FileCheck %s --implicit-check-not="call void @__sanitizer_"
3 // RUN: %clang_cc1 -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -disable-llvm-passes -std=c++11 -triple=x86_64-pc-linux -emit-llvm -o - %s | FileCheck %s --implicit-check-not="call void @__sanitizer_"
5 struct Simple {
6 int x_;
7 Simple() {
8 x_ = 5;
10 ~Simple() {
11 x_ += 1;
15 Simple s;
16 // Simple internal member is poisoned by compiler-generated dtor
17 // CHECK: define {{.*}}SimpleD2Ev{{.*}} [[ATTRIBUTE:#[0-9]+]]
18 // CHECK: call void @__sanitizer_dtor_callback_fields(
19 // CHECK: ret void
21 // Destructor does not emit any tail calls
22 // CHECK: attributes [[ATTRIBUTE]] = {{.*}}"disable-tail-calls"="true"