annotate clang/test/CodeGenCXX/sanitize-dtor-repress-aliasing.cpp @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900 (2021-06-07)
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // Test -fsanitize-memory-use-after-dtor
anatofuz
parents:
diff changeset
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
anatofuz
parents:
diff changeset
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
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 template <class T>
anatofuz
parents:
diff changeset
6 class Vector {
anatofuz
parents:
diff changeset
7 public:
anatofuz
parents:
diff changeset
8 int size;
anatofuz
parents:
diff changeset
9 ~Vector() {}
anatofuz
parents:
diff changeset
10 };
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 // Virtual function table for the derived class only contains
anatofuz
parents:
diff changeset
13 // its own destructors, with no aliasing to base class dtors.
anatofuz
parents:
diff changeset
14 struct Base {
anatofuz
parents:
diff changeset
15 Vector<int> v;
anatofuz
parents:
diff changeset
16 int x;
anatofuz
parents:
diff changeset
17 Base() { x = 5; }
anatofuz
parents:
diff changeset
18 virtual ~Base() {}
anatofuz
parents:
diff changeset
19 };
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 struct Derived : public Base {
anatofuz
parents:
diff changeset
22 int z;
anatofuz
parents:
diff changeset
23 Derived() { z = 10; }
anatofuz
parents:
diff changeset
24 ~Derived() {}
anatofuz
parents:
diff changeset
25 };
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 Derived d;
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 // Definition of virtual function table
anatofuz
parents:
diff changeset
30 // CHECK: @_ZTV7Derived = {{.*}}@_ZN7DerivedD1Ev{{.*}}@_ZN7DerivedD0Ev