summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/delete.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-04-20 02:18:25 +0000
committerJohn McCall <rjmccall@apple.com>2010-04-20 02:18:25 +0000
commit9c82afc7d1f57b427053e6679d87539b0dc63b1a (patch)
treedb8d83fe28dbdcd05df601d0e20534235dfbfd3f /test/CodeGenCXX/delete.cpp
parent3609432178ae63977d575065509238ca2fedf455 (diff)
Restore r101841 without modification. Also mark 'operator delete' as used for
actual delete expressions, not just new expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101861 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/delete.cpp')
-rw-r--r--test/CodeGenCXX/delete.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/test/CodeGenCXX/delete.cpp b/test/CodeGenCXX/delete.cpp
index 7cc264f5c5..87f8698b84 100644
--- a/test/CodeGenCXX/delete.cpp
+++ b/test/CodeGenCXX/delete.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o %t
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
void t1(int *a) {
delete a;
@@ -19,8 +19,11 @@ struct T {
int a;
};
+// CHECK: define void @_Z2t4P1T
void t4(T *t) {
- // RUN: grep "call void @_ZN1TD1Ev" %t | count 1
+ // CHECK: call void @_ZN1TD1Ev
+ // CHECK-NEXT: bitcast
+ // CHECK-NEXT: call void @_ZdlPv
delete t;
}
@@ -35,3 +38,22 @@ void f() {
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
+}