From 534ba90a1b865f3731aa56423e8f02d49ff62ec7 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Fri, 13 Nov 2009 22:29:45 +0000 Subject: 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 --- test/CodeGenCXX/array-operator-delete-call.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/CodeGenCXX/array-operator-delete-call.cpp') 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; } -- cgit v1.2.3-18-g5258