Code gen. For virtual destructor call on array objects
(still part of pr5472).
llvm-svn: 88712
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 @@
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 @@
COST::COST()
{
cost = new S[3];
+ vcost = new V[4];
cost_val = new unsigned[10];
}
@@ -34,6 +42,9 @@
if (cost) {
delete [] cost;
}
+ if (vcost) {
+ delete [] vcost;
+ }
if (cost_val)
delete [] cost_val;
}