aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/array-operator-delete-call.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-11-13 22:29:45 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-11-13 22:29:45 +0000
commitebea00581283314330a709a08b333e8a092ceb5a (patch)
treebe18593c20b74801ebb2eedfd35989f633806d34 /clang/test/CodeGenCXX/array-operator-delete-call.cpp
parent6e9901494788dffd7e300dec5c3fbbd756d738c0 (diff)
downloadllvm-ebea00581283314330a709a08b333e8a092ceb5a.zip
llvm-ebea00581283314330a709a08b333e8a092ceb5a.tar.gz
llvm-ebea00581283314330a709a08b333e8a092ceb5a.tar.bz2
Code gen. For virtual destructor call on array objects
(still part of pr5472). llvm-svn: 88712
Diffstat (limited to 'clang/test/CodeGenCXX/array-operator-delete-call.cpp')
-rw-r--r--clang/test/CodeGenCXX/array-operator-delete-call.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/array-operator-delete-call.cpp b/clang/test/CodeGenCXX/array-operator-delete-call.cpp
index d394aa1..c23d336 100644
--- a/clang/test/CodeGenCXX/array-operator-delete-call.cpp
+++ b/clang/test/CodeGenCXX/array-operator-delete-call.cpp
@@ -13,9 +13,16 @@ struct S {
int iS;
};
+struct V {
+ V() : iV (++count) { printf("V::V(%d)\n", iV); }
+ virtual ~V() { printf("V::~V(%d)\n", iV); }
+ int iV;
+};
+
struct COST
{
S *cost;
+ V *vcost;
unsigned *cost_val;
~COST();
@@ -26,6 +33,7 @@ struct COST
COST::COST()
{
cost = new S[3];
+ vcost = new V[4];
cost_val = new unsigned[10];
}
@@ -34,6 +42,9 @@ COST::~COST()
if (cost) {
delete [] cost;
}
+ if (vcost) {
+ delete [] vcost;
+ }
if (cost_val)
delete [] cost_val;
}