diff options
Diffstat (limited to 'test/CodeGenCXX/array-operator-delete-call.cpp')
-rw-r--r-- | test/CodeGenCXX/array-operator-delete-call.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGenCXX/array-operator-delete-call.cpp b/test/CodeGenCXX/array-operator-delete-call.cpp index d394aa1673..c23d33632a 100644 --- a/test/CodeGenCXX/array-operator-delete-call.cpp +++ b/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; } |