diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-11-13 22:29:45 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-11-13 22:29:45 +0000 |
commit | 534ba90a1b865f3731aa56423e8f02d49ff62ec7 (patch) | |
tree | 0995d6b9a677b8c6a70dcce7357062c57c1b39a8 /test/CodeGenCXX/array-operator-delete-call.cpp | |
parent | 22efb85eb5c09a1859956aaf408900ff83e08c53 (diff) |
Code gen. For virtual destructor call on array objects
(still part of pr5472).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88712 91177308-0d34-0410-b5e6-96231b3b80d8
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; } |