Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / sanitize-dtor-repress-aliasing.cpp
blob28624a0e7aeceb025f385bd9cfcd3d0fd398d764
1 // Test -fsanitize-memory-use-after-dtor
2 // RUN: %clang_cc1 -fsanitize=memory -O1 -fsanitize-memory-use-after-dtor -std=c++11 -triple=x86_64-pc-linux -emit-llvm -o - %s | FileCheck %s
3 // RUN: %clang_cc1 -fsanitize=memory -O2 -fsanitize-memory-use-after-dtor -std=c++11 -triple=x86_64-pc-linux -emit-llvm -o - %s | FileCheck %s
5 template <class T>
6 class Vector {
7 public:
8 int size;
9 ~Vector() {}
12 // Virtual function table for the derived class only contains
13 // its own destructors, with no aliasing to base class dtors.
14 struct Base {
15 Vector<int> v;
16 int x;
17 Base() { x = 5; }
18 virtual ~Base() {}
21 struct Derived : public Base {
22 int z;
23 Derived() { z = 10; }
24 ~Derived() {}
27 Derived d;
29 // Definition of virtual function table
30 // CHECK: @_ZTV7Derived = {{.*}}@_ZN7DerivedD1Ev{{.*}}@_ZN7DerivedD0Ev