blob: 87f8698b84c3a75a77c139607511ad0193e4e203 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
void t1(int *a) {
delete a;
}
struct S {
int a;
};
// POD types.
void t3(S *s) {
delete s;
}
// Non-POD
struct T {
~T();
int a;
};
// CHECK: define void @_Z2t4P1T
void t4(T *t) {
// CHECK: call void @_ZN1TD1Ev
// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @_ZdlPv
delete t;
}
// PR5102
template <typename T>
class A {
operator T *() const;
};
void f() {
A<char*> a;
delete a;
}
namespace test0 {
struct A {
void *operator new(__SIZE_TYPE__ sz);
void operator delete(void *p) { ::operator delete(p); }
~A() {}
};
// CHECK: define void @_ZN5test04testEPNS_1AE(
void test(A *a) {
// CHECK: call void @_ZN5test01AD1Ev
// CHECK-NEXT: bitcast
// CHECK-NEXT: call void @_ZN5test01AdlEPv
delete a;
}
// CHECK: define linkonce_odr void @_ZN5test01AD1Ev
// CHECK: define linkonce_odr void @_ZN5test01AdlEPv
}
|